Documentation ¶
Index ¶
- func UseLogger(logger l.Logger)
- type IService
- type Service
- func (s *Service) APIs() []api.API
- func (s *Service) Context() context.Context
- func (s *Service) InitContext()
- func (s *Service) InitServices()
- func (s *Service) IsShutdown() bool
- func (s *Service) IsStarted() bool
- func (s *Service) Services() *ServiceRegistry
- func (s *Service) SetKind(kind reflect.Type)
- func (s *Service) Start() error
- func (s *Service) Status() error
- func (s *Service) Stop() error
- type ServiceRegistry
- func (s *ServiceRegistry) APIs() []api.API
- func (s *ServiceRegistry) FetchService(service interface{}) error
- func (s *ServiceRegistry) GetServices() map[reflect.Type]IService
- func (s *ServiceRegistry) LowestPriority(service IService) bool
- func (s *ServiceRegistry) RegisterService(service IService) error
- func (s *ServiceRegistry) StartAll() error
- func (s *ServiceRegistry) Statuses() map[reflect.Type]error
- func (s *ServiceRegistry) StopAll() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IService ¶
type IService interface { // APIs retrieves the list of RPC descriptors the service provides APIs() []api.API // Start is called after all services have been constructed and the networking // layer was also initialized to spawn any goroutines required by the service. Start() error // Stop terminates all goroutines belonging to the service, blocking until they // are all terminated. Stop() error Status() error IsStarted() bool IsShutdown() bool Context() context.Context SetKind(kind reflect.Type) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) InitContext ¶
func (s *Service) InitContext()
func (*Service) InitServices ¶
func (s *Service) InitServices()
func (*Service) IsShutdown ¶
func (*Service) Services ¶
func (s *Service) Services() *ServiceRegistry
type ServiceRegistry ¶
type ServiceRegistry struct {
// contains filtered or unexported fields
}
func NewServiceRegistry ¶
func NewServiceRegistry() *ServiceRegistry
func (*ServiceRegistry) APIs ¶
func (s *ServiceRegistry) APIs() []api.API
func (*ServiceRegistry) FetchService ¶
func (s *ServiceRegistry) FetchService(service interface{}) error
func (*ServiceRegistry) GetServices ¶
func (s *ServiceRegistry) GetServices() map[reflect.Type]IService
func (*ServiceRegistry) LowestPriority ¶
func (s *ServiceRegistry) LowestPriority(service IService) bool
func (*ServiceRegistry) RegisterService ¶
func (s *ServiceRegistry) RegisterService(service IService) error
func (*ServiceRegistry) StartAll ¶
func (s *ServiceRegistry) StartAll() error
func (*ServiceRegistry) StopAll ¶
func (s *ServiceRegistry) StopAll() error
Click to show internal directories.
Click to hide internal directories.