Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceController ¶
type ServiceController interface { Add(name ServiceName, s Service) error Start() error Stop() error }
ServiceController defines the interface for a service manager.
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
ServiceManager is responsible for managing multiple services.
func (*ServiceManager) Add ¶
func (sm *ServiceManager) Add(name ServiceName, s Service) error
Add adds a service to the ServiceManager. It returns an error if a Start or Stop operation is currently in progress.
func (*ServiceManager) Start ¶
func (sm *ServiceManager) Start() error
Start starts all services concurrently. If any service fails to start, it stops the already started services and returns the error.
func (*ServiceManager) Stop ¶
func (sm *ServiceManager) Stop() error
Stop stops all services concurrently. If any service fails to stop, it continues to stop other services and returns the error.
Click to show internal directories.
Click to hide internal directories.