diff --git a/pkg/admin/api/grpc/org.go b/pkg/admin/api/grpc/org.go new file mode 100644 index 0000000000..26e5bf4424 --- /dev/null +++ b/pkg/admin/api/grpc/org.go @@ -0,0 +1,22 @@ +package grpc + +import ( + "context" + "github.com/caos/zitadel/internal/errors" +) + +func (s *Server) GetOrgByID(ctx context.Context, orgID *OrgID) (_ *Org, err error) { + return nil, errors.ThrowUnimplemented(nil, "GRPC-ruc8e", "Not implemented") +} + +func (s *Server) SearchOrgs(ctx context.Context, request *OrgSearchRequest) (_ *OrgSearchResponse, err error) { + return nil, errors.ThrowUnimplemented(nil, "GRPC-ruc8e", "Not implemented") +} + +func (s *Server) IsOrgUnique(ctx context.Context, request *UniqueOrgRequest) (org *UniqueOrgResponse, err error) { + return nil, errors.ThrowUnimplemented(nil, "GRPC-ruc8e", "Not implemented") +} + +func (s *Server) SetUpOrg(ctx context.Context, orgSetUp *OrgSetUpRequest) (_ *OrgSetUpResponse, err error) { + return nil, errors.ThrowUnimplemented(nil, "GRPC-ruc8e", "Not implemented") +} diff --git a/pkg/admin/api/grpc/probes.go b/pkg/admin/api/grpc/probes.go new file mode 100644 index 0000000000..31b7bfeba6 --- /dev/null +++ b/pkg/admin/api/grpc/probes.go @@ -0,0 +1,20 @@ +package grpc + +import ( + "context" + "github.com/caos/zitadel/internal/errors" + "github.com/golang/protobuf/ptypes/empty" + pb_struct "github.com/golang/protobuf/ptypes/struct" +) + +func (s *Server) Healthz(_ context.Context, e *empty.Empty) (*empty.Empty, error) { + return nil, errors.ThrowUnimplemented(nil, "GRPC-ruc8e", "Not implemented") +} + +func (s *Server) Ready(ctx context.Context, e *empty.Empty) (*empty.Empty, error) { + return nil, errors.ThrowUnimplemented(nil, "GRPC-ruc8e", "Not implemented") +} + +func (s *Server) Validate(ctx context.Context, _ *empty.Empty) (*pb_struct.Struct, error) { + return nil, errors.ThrowUnimplemented(nil, "GRPC-ruc8e", "Not implemented") +} diff --git a/pkg/admin/api/grpc/server.go b/pkg/admin/api/grpc/server.go new file mode 100644 index 0000000000..a1ea0fe3e5 --- /dev/null +++ b/pkg/admin/api/grpc/server.go @@ -0,0 +1,34 @@ +package grpc + +import ( + grpc "google.golang.org/grpc" +) + +var _ AdminServiceServer = (*Server)(nil) + +type Config struct { + Port string + SearchLimit int +} + +type Server struct { + port string + searchLimit int +} + +func StartServer(conf Config) *Server { + return &Server{ + port: conf.Port, + searchLimit: conf.SearchLimit, + } +} + +func (s *Server) GRPCPort() string { + return s.port +} + +func (s *Server) GRPCServer() (*grpc.Server, error) { + gs := grpc.NewServer() + RegisterAdminServiceServer(gs, s) + return gs, nil +}