Documentation ¶
Index ¶
- Constants
- type ActionArgs
- type Config
- type ConfigData
- type CreateArgs
- type CreateResult
- type DisableArgs
- type EnableArgs
- type GetArgs
- type GetResult
- type ListResult
- type MockSystemd
- func (s *MockSystemd) ClearData()
- func (s *MockSystemd) Create(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) Disable(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) Enable(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) Get(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) List(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) ManualCreate(args CreateArgs, enable bool)
- func (s *MockSystemd) ManualEnable(name string)
- func (s *MockSystemd) ManualGet(name string) *UnitStatus
- func (s *MockSystemd) RegisterTasks(server *provider.Server)
- func (s *MockSystemd) Remove(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) Restart(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) Start(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *MockSystemd) Stop(req *acomm.Request) (interface{}, *url.URL, error)
- type MockSystemdData
- type RemoveArgs
- type Systemd
- func (s *Systemd) Create(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) Disable(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) Enable(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) Get(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) List(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) RegisterTasks(server *provider.Server)
- func (s *Systemd) Remove(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) Restart(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) Start(req *acomm.Request) (interface{}, *url.URL, error)
- func (s *Systemd) Stop(req *acomm.Request) (interface{}, *url.URL, error)
- type UnitStatus
Constants ¶
const ( ModeReplace = "replace" ModeFail = "fail" ModeIsolate = "isolate" ModeIgnoreDeps = "ignore-dependencies" ModeIgnoreReqs = "ignore-requirements" )
Unit start modes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionArgs ¶
ActionArgs are arguments for service running action handlers.
type Config ¶
Config holds all configuration for the provider.
func (*Config) LoadConfig ¶
LoadConfig loads and validates the Systemd provider config
func (*Config) UnitFilePath ¶
UnitFilePath returns the absolute path of the unit file for a unit.
type ConfigData ¶
type ConfigData struct { provider.ConfigData UnitFileDir string `json:"unit_file_dir"` }
ConfigData defines the structure of the config data (e.g. in the config file)
type CreateArgs ¶
type CreateArgs struct { Name string `json:"name"` UnitOptions []*unit.UnitOption `json:"unit-options"` Overwrite bool `json:"overwrite"` }
CreateArgs are arguments for the Create handler.
type CreateResult ¶
type CreateResult struct {
UnitModified bool `json:"modified"`
}
CreateResult is the result of a create action.
type DisableArgs ¶
DisableArgs are arguments for the disable handler.
type EnableArgs ¶
type EnableArgs struct { Name string `json:"name"` Runtime bool `json:"runtime"` Force bool `json:"force"` }
EnableArgs are arguments for the disable handler.
type GetArgs ¶
type GetArgs struct {
Name string `json:"name"`
}
GetArgs are args for the Get handler
type GetResult ¶
type GetResult struct {
Unit UnitStatus `json:"unit"`
}
GetResult is the result of the ListUnits handler.
type ListResult ¶
type ListResult struct {
Units []UnitStatus `json:"units"`
}
ListResult is the result of the List handler.
type MockSystemd ¶
type MockSystemd struct {
Data *MockSystemdData
}
MockSystemd is a mock version of the Systemd provider.
func (*MockSystemd) ClearData ¶
func (s *MockSystemd) ClearData()
ClearData clears all data out of the mock provider.
func (*MockSystemd) ManualCreate ¶
func (s *MockSystemd) ManualCreate(args CreateArgs, enable bool)
ManualCreate directly creates a service in the mock data, optionally enabled.
func (*MockSystemd) ManualEnable ¶
func (s *MockSystemd) ManualEnable(name string)
ManualEnable directly enables a service in the mock data.
func (*MockSystemd) ManualGet ¶
func (s *MockSystemd) ManualGet(name string) *UnitStatus
ManualGet directly retrieves a services from the mock data.
func (*MockSystemd) RegisterTasks ¶
func (s *MockSystemd) RegisterTasks(server *provider.Server)
RegisterTasks registers the MockSystemd tasks.
type MockSystemdData ¶
type MockSystemdData struct { Statuses map[string]UnitStatus UnitFiles map[string][]*unit.UnitOption }
MockSystemdData is the in-memory data structure for the MockSystemd.
type RemoveArgs ¶
type RemoveArgs struct {
Name string `json:"name"`
}
RemoveArgs are arguments for the Remove handler.
type Systemd ¶
type Systemd struct {
// contains filtered or unexported fields
}
Systemd is a provider of systemd functionality.
func (*Systemd) RegisterTasks ¶
RegisterTasks registers all of Systemd's task handlers with the server.
type UnitStatus ¶
type UnitStatus struct { dbus.UnitStatus Uptime time.Duration `json:"uptime"` UnitProperties map[string]interface{} `json:"unitProperties"` UnitTypeProperties map[string]interface{} `json:"unitTypeProperties"` }
UnitStatus contains information about a systemd unit.