Documentation ¶
Index ¶
- Variables
- func KillAllOldUnits()
- type DBusConnectionInterface
- type Unit
- func (unit *Unit) Create()
- func (unit *Unit) Destroy()
- func (unit *Unit) LoadAndWatch()
- func (unit *Unit) PutOnQueue()
- func (unit *Unit) Restart()
- func (unit *Unit) SaveOnEtcd() error
- func (unit *Unit) SetDesiredState(s state.State)
- func (unit *Unit) SetState(s state.State)
- func (unit *Unit) Start()
- func (unit *Unit) Stop()
- func (unit *Unit) WaitOnDestroy()
- func (unit *Unit) WaitOnState(s state.State)
- func (unit *Unit) Watch()
- type UnitInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Config is a pointer need to be set to the main configuration Config *config.ConfigurationInfo //EtcdAPI is the etcd keys api EtcdAPI interfaces.EtcdAPI = etcdclient.GetEtcdv3() // DBusConnection is the connection to the system's D-Bus DBusConnection DBusConnectionInterface // FS is the file system to be used FS = afero.NewOsFs() )
Functions ¶
func KillAllOldUnits ¶
func KillAllOldUnits()
KillAllOldUnits makes sure all old Dispatch spawned unit files on the system are deleted
Types ¶
type DBusConnectionInterface ¶
type DBusConnectionInterface interface { StartUnit(name string, mode string, ch chan<- string) (int, error) StopUnit(name string, mode string, ch chan<- string) (int, error) KillUnit(name string, signal int32) LinkUnitFiles(files []string, runtime bool, force bool) ([]dbus.LinkUnitFileChange, error) Reload() error }
DBusConnectionInterface is the interface of a DBus connection
type Unit ¶
type Unit struct { Name string `json:"name"` Machine string `json:"machine"` Template string `json:"template,omitempty"` // is set with template name if from Template Global string `json:"global,omitempty"` // is set with global name if from global State state.State DesiredState state.State Ports []int64 `json:"ports"` Constraints map[string]string UnitContent string `json:"unitContent"` // contains filtered or unexported fields }
Unit is a struct containing all info of a specific unit
func NewFromEtcd ¶
NewFromEtcd creates a new unit with info from etcd
func NewFromEtcdWithCache ¶
NewFromEtcdWithCache creates a new unit with info from etcd using a specified cache
func (*Unit) LoadAndWatch ¶
func (unit *Unit) LoadAndWatch()
LoadAndWatch loads the unit to the system and follows the desired state
func (*Unit) PutOnQueue ¶
func (unit *Unit) PutOnQueue()
PutOnQueue places a specific unit on the queue
func (*Unit) SetDesiredState ¶
SetDesiredState sets the desiredstate of the unit and updates etcd
func (*Unit) WaitOnDestroy ¶
func (unit *Unit) WaitOnDestroy()
WaitOnDestroy waits for the unit to enter a destroyed state
func (*Unit) WaitOnState ¶
WaitOnState waits for the unit to enter a specific state
Click to show internal directories.
Click to hide internal directories.