2020-03-25 09:54:45 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-04-07 11:23:04 +00:00
|
|
|
"github.com/caos/zitadel/internal/api/auth"
|
|
|
|
"github.com/caos/zitadel/internal/management/repository"
|
2020-03-25 10:17:38 +00:00
|
|
|
|
|
|
|
grpc_util "github.com/caos/zitadel/internal/api/grpc"
|
2020-03-25 09:54:45 +00:00
|
|
|
"github.com/caos/zitadel/internal/api/grpc/server"
|
|
|
|
"github.com/caos/zitadel/pkg/management/api/grpc"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Config struct {
|
2020-03-25 10:17:38 +00:00
|
|
|
GRPC grpc_util.Config
|
2020-03-25 09:54:45 +00:00
|
|
|
}
|
|
|
|
|
2020-04-07 11:23:04 +00:00
|
|
|
func Start(ctx context.Context, conf Config, authZ auth.Config, repo repository.Repository) {
|
|
|
|
grpcServer := grpc.StartServer(conf.GRPC.ToServerConfig(), authZ, repo)
|
2020-03-31 09:07:48 +00:00
|
|
|
grpcGateway := grpc.StartGateway(conf.GRPC.ToGatewayConfig())
|
2020-03-25 09:54:45 +00:00
|
|
|
|
2020-03-31 09:07:48 +00:00
|
|
|
server.StartServer(ctx, grpcServer)
|
|
|
|
server.StartGateway(ctx, grpcGateway)
|
2020-03-25 09:54:45 +00:00
|
|
|
}
|