mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
29 lines
598 B
Go
29 lines
598 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
grpc_util "github.com/caos/zitadel/internal/api/grpc"
|
|
"github.com/caos/zitadel/internal/api/grpc/server"
|
|
"github.com/caos/zitadel/pkg/admin/api/grpc"
|
|
)
|
|
|
|
type API struct {
|
|
grpcServer grpc.Server
|
|
gateway grpc.Gateway
|
|
}
|
|
|
|
type Config struct {
|
|
GRPC grpc_util.Config
|
|
}
|
|
|
|
func Start(ctx context.Context, conf *Config) error {
|
|
api := &API{
|
|
grpcServer: *grpc.StartServer(conf.GRPC.ToServerConfig()),
|
|
gateway: *grpc.StartGateway(conf.GRPC.ToGatewayConfig()),
|
|
}
|
|
server.StartServer(ctx, &api.grpcServer)
|
|
server.StartGateway(ctx, &api.gateway)
|
|
|
|
return nil
|
|
}
|