Documentation
¶
Index ¶
- type ExecCode
- type ExecCommandState
- type Manager
- func (m *Manager) Close()
- func (m *Manager) Disable(unitname string) error
- func (m *Manager) Enable(unitname string) error
- func (m *Manager) GetAllUnits(pattern string) ([]*UnitStatus, error)
- func (m *Manager) GetUnit(unitname string) (*UnitStatus, error)
- func (m *Manager) GetUnitProperties(unitname string) (*UnitProperties, error)
- func (m *Manager) Kill(unitname string, signal syscall.Signal)
- func (m *Manager) KillBySIGKILL(unitname string)
- func (m *Manager) KillBySIGTERM(unitname string)
- func (m *Manager) Restart(unitname string, ch chan<- string) error
- func (m *Manager) Start(unitname string, ch chan<- string) error
- func (m *Manager) StartAndTest(unitname string, interval time.Duration, ch chan<- string) error
- func (m *Manager) Stop(unitname string, ch chan<- string) error
- func (m *Manager) StopAndWait(unitname string, interval time.Duration, ch chan<- string) error
- type UnitProperties
- type UnitStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecCommandState ¶
type ExecCommandState struct {
Path string // The binary path to execute
Arguments []string // An array with all arguments to pass to the executed command, starting with argument 0
Fail bool // A boolean whether it should be considered a failure if the process exits uncleanly
EnterTime time.Time // CLOCK_REALTIME time when the process began running the last time
EnterTimeMono int64 // CLOCK_MONOTONIC usec timestamps when the process began running the last time
ExitTime time.Time // CLOCK_REALTIME time when the process finished running the last time
ExitTimeMono int64 // CLOCK_MONOTONIC usec timestamps when the process finished running the last time
ExecPID int // The PID of the process (or 0 if it has not run yet)
ExecCode ExecCode // The exit code of the last run
ExecStatus int // The exit status
}
func (*ExecCommandState) UnmarshalJSON ¶
func (s *ExecCommandState) UnmarshalJSON(b []byte) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) GetAllUnits ¶
func (m *Manager) GetAllUnits(pattern string) ([]*UnitStatus, error)
func (*Manager) GetUnitProperties ¶
func (m *Manager) GetUnitProperties(unitname string) (*UnitProperties, error)
func (*Manager) KillBySIGKILL ¶
func (*Manager) KillBySIGTERM ¶
func (*Manager) StartAndTest ¶
type UnitProperties ¶
type UnitProperties struct {
Name string `json:"-"` // The primary unit name as string
LoadState string // The load state (i.e. whether the unit file has been loaded successfully)
ActiveState string // The active state (i.e. whether the unit is currently started or not)
SubState string // The sub state (a more fine-grained version of the active state that is specific to the unit type, which the active state is not)
ExecMainPID int // The main PID is the current main PID of the service and is 0 when the service currently has no main PID
ActiveEnterTime time.Time
ActiveExitTime time.Time
StateChangeTime time.Time
ExecStart []ExecCommandState
ExecStartPost []ExecCommandState
ExecStartPre []ExecCommandState
ExecStop []ExecCommandState
ExecStopPost []ExecCommandState
}
type UnitStatus ¶
type UnitStatus struct {
Name string // The primary unit name as string
LoadState string // The load state (i.e. whether the unit file has been loaded successfully)
ActiveState string // The active state (i.e. whether the unit is currently started or not)
SubState string // The sub state (a more fine-grained version of the active state that is specific to the unit type, which the active state is not)
}
Click to show internal directories.
Click to hide internal directories.