Documentation
¶
Index ¶
- Variables
- type ProcessExit
- type ServiceStatus
- type Supervisor
- func (sv *Supervisor) ExitChannel() chan<- ProcessExit
- func (sv *Supervisor) GetServiceStatus(name string) (*ServiceStatus, error)
- func (sv *Supervisor) ListServices() []ServiceStatus
- func (sv *Supervisor) LoadInternalService(s *service.Service)
- func (sv *Supervisor) LoadService(name string) error
- func (sv *Supervisor) LoadServices(names ...string) []error
- func (sv *Supervisor) RestartService(name string) error
- func (sv *Supervisor) StartAll()
- func (sv *Supervisor) StartService(name string) error
- func (sv *Supervisor) Stop()
- func (sv *Supervisor) StopService(name string) error
- func (sv *Supervisor) Supervise()
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("service not found")
Functions ¶
This section is empty.
Types ¶
type ProcessExit ¶
type ProcessExit struct {
PID int
Status syscall.WaitStatus
}
ProcessExit contains information about an exited process
type ServiceStatus ¶
type ServiceStatus struct {
Name string
Description string
Type string
Restart string
Running bool
Started bool
Failed bool
PID int
}
ServiceStatus represents the current status of a service
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func NewSupervisor ¶
func NewSupervisor() *Supervisor
NewSupervisor creates a new supervisor instance
func (*Supervisor) ExitChannel ¶
func (sv *Supervisor) ExitChannel() chan<- ProcessExit
ExitChannel returns the channel for receiving process exit information
func (*Supervisor) GetServiceStatus ¶
func (sv *Supervisor) GetServiceStatus(name string) (*ServiceStatus, error)
ServiceStatus returns the status of a specific service
func (*Supervisor) ListServices ¶
func (sv *Supervisor) ListServices() []ServiceStatus
ListServices returns the status of all services
func (*Supervisor) LoadInternalService ¶
func (sv *Supervisor) LoadInternalService(s *service.Service)
func (*Supervisor) LoadService ¶
func (sv *Supervisor) LoadService(name string) error
func (*Supervisor) LoadServices ¶
func (sv *Supervisor) LoadServices(names ...string) []error
func (*Supervisor) RestartService ¶
func (sv *Supervisor) RestartService(name string) error
RestartService restarts a specific service by name
func (*Supervisor) StartAll ¶
func (sv *Supervisor) StartAll()
func (*Supervisor) StartService ¶
func (sv *Supervisor) StartService(name string) error
StartService starts a specific service by name
func (*Supervisor) Stop ¶
func (sv *Supervisor) Stop()
func (*Supervisor) StopService ¶
func (sv *Supervisor) StopService(name string) error
StopService stops a specific service by name
func (*Supervisor) Supervise ¶
func (sv *Supervisor) Supervise()
Click to show internal directories.
Click to hide internal directories.