Documentation ¶
Overview ¶
Load and parse dnotated units.
Interact with SystemD and the file system to read Dnotated units.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadDnotatedUnit ¶
func LoadDnotatedUnit(path string) (*models.DnotatedUnit, error)
Load a dnotated unit from a path by parsing the comment- header in the file, if present.
Types ¶
type DnotatedSystemd ¶
type DnotatedSystemd struct {
// contains filtered or unexported fields
}
An object that can be used to read Dnotated units from the system by reading files managed by SystemD. Connection to Dbus should be closed after use with .Close
func NewDnotatedSystemd ¶
func NewDnotatedSystemd() (*DnotatedSystemd, error)
func (*DnotatedSystemd) Close ¶
func (s *DnotatedSystemd) Close()
func (*DnotatedSystemd) ListUnits ¶
func (s *DnotatedSystemd) ListUnits(ctx context.Context) (*[]models.DnotatedUnit, error)
List all current Dnotated units, returning the annotation data from all files that have been properly annotated, along with status information about each unit.
type UnitStatus ¶
type UnitStatus struct { Name string // The primary unit name as string Description string // The human readable description 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) Followed string // A unit that is being followed in its state by this unit, if there is any, otherwise the empty string. Path dbus.ObjectPath // The unit object path JobId uint32 // If there is a job queued for the job unit the numeric job id, 0 otherwise JobType string // The job type as string JobPath dbus.ObjectPath // The job object path }
func (UnitStatus) String ¶
func (u UnitStatus) String() string
Click to show internal directories.
Click to hide internal directories.