service

package
v1.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(logger l.Logger)

UseLogger uses a specified Logger to output package logging info.

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) APIs

func (s *Service) APIs() []api.API

func (*Service) Context

func (s *Service) Context() context.Context

func (*Service) InitContext

func (s *Service) InitContext()

func (*Service) InitServices

func (s *Service) InitServices()

func (*Service) IsShutdown

func (s *Service) IsShutdown() bool

func (*Service) IsStarted

func (s *Service) IsStarted() bool

func (*Service) Services

func (s *Service) Services() *ServiceRegistry

func (*Service) SetKind

func (s *Service) SetKind(kind reflect.Type)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Status

func (s *Service) Status() error

func (*Service) Stop

func (s *Service) Stop() error

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) Statuses

func (s *ServiceRegistry) Statuses() map[reflect.Type]error

func (*ServiceRegistry) StopAll

func (s *ServiceRegistry) StopAll() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL