Documentation ¶
Overview ¶
Package registry is used to register the services. TODO: Use the `uber/fx` to manage the lifecycle of services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ServerServiceRegistry is the global grpc service registry. ServerServiceRegistry = NewServerServiceRegistry() )
Functions ¶
This section is empty.
Types ¶
type RegistrableService ¶
type RegistrableService interface { RegisterGRPCService(g *grpc.Server) RegisterRESTHandler(userDefineHandlers map[string]http.Handler) }
RegistrableService is the interface that should wraps the RegisterService method.
type ServiceBuilder ¶
type ServiceBuilder func(bs.Server) RegistrableService
ServiceBuilder is a function that creates a grpc service.
type ServiceRegistry ¶
type ServiceRegistry struct {
// contains filtered or unexported fields
}
ServiceRegistry is a map that stores all registered grpc services. It implements the `ServiceRegistry` interface.
func NewServerServiceRegistry ¶
func NewServerServiceRegistry() *ServiceRegistry
NewServerServiceRegistry creates a new ServiceRegistry.
func (*ServiceRegistry) InstallAllGRPCServices ¶
func (r *ServiceRegistry) InstallAllGRPCServices(srv bs.Server, g *grpc.Server)
InstallAllGRPCServices installs all registered grpc services.
func (*ServiceRegistry) InstallAllRESTHandler ¶
InstallAllRESTHandler installs all registered REST services.
func (*ServiceRegistry) RegisterService ¶
func (r *ServiceRegistry) RegisterService(name string, service ServiceBuilder)
RegisterService registers a grpc service.
Click to show internal directories.
Click to hide internal directories.