Documentation ¶
Overview ¶
Package systemd facilitates systemd status queries via dbus.
Index ¶
Constants ¶
View Source
const ( ConditionNeutral = 0 ConditionHealthy = 1 ConditionBad = 2 )
Condition values.
Variables ¶
View Source
var ErrNotSupported = errors.New("not supported on systems without systemd")
ErrNotSupported is returned by calls on systems that don't support the systemd.
Functions ¶
This section is empty.
Types ¶
type UnitStatus ¶
type UnitStatus struct { Name string Description string LoadState string ActiveState string SubState string InactiveExitTimestamp time.Time ActiveEnterTimestamp time.Time ActiveExitTimestamp time.Time InactiveEnterTimestamp time.Time }
UnitStatus describes the current status of a machina systemd unit.
func ListUnitStatuses ¶
func ListUnitStatuses(ctx context.Context, units ...string) ([]UnitStatus, error)
ListUnitStatuses returns a slice of systemd unit status entries, one for each requested unit.
func (UnitStatus) ActiveStateCondition ¶
func (s UnitStatus) ActiveStateCondition() Condition
ActiveStateCondition returns an evaluation of the unit's active state.
func (UnitStatus) Duration ¶
func (s UnitStatus) Duration() time.Duration
Duration returns the duration of the current status condition.
func (UnitStatus) LoadStateCondition ¶
func (s UnitStatus) LoadStateCondition() Condition
LoadStateCondition returns an evaluation of the unit's load state.
func (UnitStatus) State ¶
func (s UnitStatus) State() string
State returns a string describing the state of the unit.
Click to show internal directories.
Click to hide internal directories.