Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SupportedUnitTypes ¶ added in v0.3.0
func SupportedUnitTypes() []string
Types ¶
type Unit ¶ added in v0.3.0
type Unit struct { // Contents represents the parsed unit file. // This field must be considered readonly. Contents map[string]map[string][]string // Raw represents the entire contents of the unit file. Raw string }
A Unit represents a systemd configuration which encodes information about any of the unit types that fleet supports (as defined in SupportedUnitTypes()). Units are linked to Jobs by the Hash of their contents. Similar to systemd, a Unit configuration has no inherent name, but is rather named through the reference to it; in the case of systemd, the reference is the filename, and in the case of fleet, the reference is the name of the job that references this Unit.
func NewUnitFromLegacyContents ¶ added in v0.3.0
NewUnitFromLegacyContents creates a Unit object from an obsolete unit file datastructure. This should only be used to remain backwards-compatible where necessary.
func (*Unit) Description ¶ added in v0.3.0
Description returns the first Description option found in the Unit section. If the option is not defined, an empty string is returned.
type UnitState ¶ added in v0.3.0
type UnitState struct { LoadState string `json:"loadState"` ActiveState string `json:"activeState"` SubState string `json:"subState"` MachineState *machine.MachineState `json:"machineState"` }
UnitState encodes the current state of a unit loaded into systemd
func NewUnitState ¶ added in v0.3.0
func NewUnitState(loadState, activeState, subState string, ms *machine.MachineState) *UnitState