Documentation ¶
Index ¶
- type EventStream
- type SystemdManager
- func (m *SystemdManager) GetUnitState(jobName string) (*unit.UnitState, error)
- func (m *SystemdManager) LoadJob(job *job.Job)
- func (m *SystemdManager) MarshalJSON() ([]byte, error)
- func (m *SystemdManager) Publish(bus *event.EventBus, stopchan chan bool)
- func (m *SystemdManager) StartJob(jobName string)
- func (m *SystemdManager) StopJob(jobName string)
- func (m *SystemdManager) UnloadJob(jobName string)
Constants ¶
This section is empty.
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 { Systemd *dbus.Conn Machine *machine.Machine // contains filtered or unexported fields }
func NewSystemdManager ¶
func NewSystemdManager(machine *machine.Machine) (*SystemdManager, error)
func (*SystemdManager) GetUnitState ¶ added in v0.3.0
func (m *SystemdManager) GetUnitState(jobName string) (*unit.UnitState, error)
GetUnitState generates a UnitState object representing the current state of a Job's unit
func (*SystemdManager) LoadJob ¶ added in v0.3.0
func (m *SystemdManager) LoadJob(job *job.Job)
LoadJob writes the unit of the given Job to disk, subscribes to relevant dbus events, and only if necessary, instructs 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) StartJob ¶
func (m *SystemdManager) StartJob(jobName string)
StartJob starts the unit created for the indicated Job
func (*SystemdManager) StopJob ¶
func (m *SystemdManager) StopJob(jobName string)
StopJob stops the unit created for the indicated Job
func (*SystemdManager) UnloadJob ¶ added in v0.3.0
func (m *SystemdManager) UnloadJob(jobName string)
UnloadJob removes the unit associated with the indicated Job from the filesystem, unsubscribing from relevant dbus events
Click to show internal directories.
Click to hide internal directories.