mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-07 07:16:54 +00:00
60 lines
1.5 KiB
Go
60 lines
1.5 KiB
Go
package instance
|
|
|
|
import (
|
|
"google.golang.org/grpc"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
|
"github.com/zitadel/zitadel/internal/command"
|
|
"github.com/zitadel/zitadel/internal/config/systemdefaults"
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
"github.com/zitadel/zitadel/pkg/grpc/instance/v2"
|
|
)
|
|
|
|
var _ instance.InstanceServiceServer = (*Server)(nil)
|
|
|
|
type Server struct {
|
|
instance.UnimplementedInstanceServiceServer
|
|
command *command.Commands
|
|
query *query.Queries
|
|
checkPermission domain.PermissionCheck
|
|
systemDefaults systemdefaults.SystemDefaults
|
|
}
|
|
|
|
type Config struct{}
|
|
|
|
func CreateServer(
|
|
command *command.Commands,
|
|
query *query.Queries,
|
|
checkPermission domain.PermissionCheck,
|
|
systemDefaults systemdefaults.SystemDefaults,
|
|
) *Server {
|
|
return &Server{
|
|
command: command,
|
|
query: query,
|
|
checkPermission: checkPermission,
|
|
systemDefaults: systemDefaults,
|
|
}
|
|
}
|
|
|
|
func (s *Server) RegisterServer(grpcServer *grpc.Server) {
|
|
instance.RegisterInstanceServiceServer(grpcServer, s)
|
|
}
|
|
|
|
func (s *Server) AppName() string {
|
|
return instance.InstanceService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) MethodPrefix() string {
|
|
return instance.InstanceService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
|
return instance.InstanceService_AuthMethods
|
|
}
|
|
|
|
func (s *Server) RegisterGateway() server.RegisterGatewayFunc {
|
|
return instance.RegisterInstanceServiceHandler
|
|
}
|