Documentation ¶
Index ¶
- Variables
- type SystemdClient
- func (sdc *SystemdClient) Disable(unit string) error
- func (sdc *SystemdClient) Enable(unit string) error
- func (sdc *SystemdClient) Exists(unit string) (bool, error)
- func (sdc *SystemdClient) IsActive(unit string) (bool, error)
- func (sdc *SystemdClient) Reload() error
- func (sdc *SystemdClient) Restart(unit string) error
- func (sdc *SystemdClient) Start(unit string) error
- func (sdc *SystemdClient) Stop(unit string) error
- func (sdc *SystemdClient) StopAndRemove(unit string, filesToRemove ...string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SystemdError = errgo.New("systemd error")
)
Functions ¶
This section is empty.
Types ¶
type SystemdClient ¶
type SystemdClient struct {
Logger *logging.Logger
}
func NewSystemdClient ¶
func NewSystemdClient(logger *logging.Logger) *SystemdClient
NewSystemdClient creates a new systemd client
func (*SystemdClient) Disable ¶
func (sdc *SystemdClient) Disable(unit string) error
Disable behaves as `systemctl disable <unit>`
func (*SystemdClient) Enable ¶
func (sdc *SystemdClient) Enable(unit string) error
Enable behaves as `systemctl enable <unit>`
func (*SystemdClient) Exists ¶
func (sdc *SystemdClient) Exists(unit string) (bool, error)
Exists returns true if the given unit exists, false otherwise.
func (*SystemdClient) IsActive ¶
func (sdc *SystemdClient) IsActive(unit string) (bool, error)
IsActive returns true if the given unit exists and its ActiveState is 'active', false otherwise.
func (*SystemdClient) Reload ¶
func (sdc *SystemdClient) Reload() error
Reload behaves as `systemctl daemon-reload`
func (*SystemdClient) Restart ¶
func (sdc *SystemdClient) Restart(unit string) error
Restart behaves as `systemctl restart <unit>`
func (*SystemdClient) Start ¶
func (sdc *SystemdClient) Start(unit string) error
Start behaves as `systemctl start <unit>`
func (*SystemdClient) Stop ¶
func (sdc *SystemdClient) Stop(unit string) error
Stop behaves as `systemctl stop <unit>`
func (*SystemdClient) StopAndRemove ¶
func (sdc *SystemdClient) StopAndRemove(unit string, filesToRemove ...string) error
StopAndRemove stops the given unit, disables it, and removes all given files.
Click to show internal directories.
Click to hide internal directories.