Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface { Init(ctx context.Context) error Start(ctx context.Context) error Stop(ctx context.Context) error }
Service is an interface for services that can be started and stopped.
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
func NewServiceManager ¶
func NewServiceManager() *ServiceManager
func (*ServiceManager) AddService ¶
func (sm *ServiceManager) AddService(name string, service Service)
func (*ServiceManager) StartAllAndWait ¶
func (sm *ServiceManager) StartAllAndWait(ctx context.Context) error
StartAllAndWait starts all services and waits for them to complete or error. If any service errors, all other services are stopped gracefully and the error is returned.
Click to show internal directories.
Click to hide internal directories.