Documentation ¶
Index ¶
- Constants
- type EventStream
- type SystemdManager
- func (m *SystemdManager) GetUnitState(name string) (*unit.UnitState, error)
- func (m *SystemdManager) Load(name string, u unit.Unit) error
- func (m *SystemdManager) MarshalJSON() ([]byte, error)
- func (m *SystemdManager) Publish(bus *event.EventBus, stopchan chan bool)
- func (m *SystemdManager) Start(name string)
- func (m *SystemdManager) Stop(name string)
- func (m *SystemdManager) Units() (units []string, err error)
- func (m *SystemdManager) Unload(name string)
Constants ¶
View Source
const (
DefaultUnitsDirectory = "/run/fleet/units/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
func NewEventStream ¶
func NewEventStream() *EventStream
func (*EventStream) Close ¶
func (es *EventStream) Close()
func (*EventStream) Stream ¶
func (es *EventStream) Stream(unitchan <-chan map[string]*dbus.UnitStatus, eventchan chan *event.Event)
type SystemdManager ¶
type SystemdManager struct { UnitsDir string // contains filtered or unexported fields }
func NewSystemdManager ¶
func NewSystemdManager(uDir string) (*SystemdManager, error)
func (*SystemdManager) GetUnitState ¶ added in v0.3.0
func (m *SystemdManager) GetUnitState(name string) (*unit.UnitState, error)
GetUnitState generates a UnitState object representing the current state of a Unit
func (*SystemdManager) Load ¶ added in v0.3.1
func (m *SystemdManager) Load(name string, u unit.Unit) error
Load writes the given Unit to disk, subscribing to relevant dbus events, and, if necessary, instructing the systemd daemon to reload.
func (*SystemdManager) MarshalJSON ¶ added in v0.2.0
func (m *SystemdManager) MarshalJSON() ([]byte, error)
func (*SystemdManager) Publish ¶
func (m *SystemdManager) Publish(bus *event.EventBus, stopchan chan bool)
Publish is a long-running function that streams dbus events through a translation layer and on to the EventBus
func (*SystemdManager) Start ¶ added in v0.3.1
func (m *SystemdManager) Start(name string)
Start starts the unit identified by the given name
func (*SystemdManager) Stop ¶ added in v0.3.1
func (m *SystemdManager) Stop(name string)
Stop stops the unit identified by the given name
func (*SystemdManager) Units ¶ added in v0.3.1
func (m *SystemdManager) Units() (units []string, err error)
Units enumerates all files recognized as valid systemd units in this manager's units directory.
func (*SystemdManager) Unload ¶ added in v0.3.1
func (m *SystemdManager) Unload(name string)
Unload removes the indicated unit from the filesystem, unsubscribing from relevant dbus events.
Click to show internal directories.
Click to hide internal directories.