mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
35 lines
535 B
Go
35 lines
535 B
Go
package grpc
|
|
|
|
import (
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
var _ ManagementServiceServer = (*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()
|
|
RegisterManagementServiceServer(gs, s)
|
|
return gs, nil
|
|
}
|