fix: add server

This commit is contained in:
Fabiennne 2020-03-24 07:09:28 +01:00
parent e55b137455
commit 46c3289ee3
3 changed files with 76 additions and 0 deletions

22
pkg/admin/api/grpc/org.go Normal file
View File

@ -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")
}

View File

@ -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")
}

View File

@ -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
}