service

package
v0.0.0-...-bb2520b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUnit

func DeleteUnit(name string) error

DeleteUnit deletes the specified unit file

func DisableUnitFile

func DisableUnitFile(name string) error

DisableUnitFile may be used to disable the specified unit by removing symlinks to it

func EnableUnitFile

func EnableUnitFile(name string) error

EnableUnitFile may be used to enable the specified unit by creating symlinks to it

func ListUnit

func ListUnit(name string) (dbus.UnitStatus, error)

ListUnit returns status information of the specified unit

func ReadUnitFile

func ReadUnitFile(filename string) ([]*unit.UnitOption, error)

ReadUnitFile reads the specified unit file

func ReloadDaemon

func ReloadDaemon() error

func ResetFailedUnitFile

func ResetFailedUnitFile(name string) error

func RestartUnit

func RestartUnit(name string, mode string) error

RestartUnit restarts an unit

func StartUnit

func StartUnit(name string, mode string) error

StartUnit enqueues a start job and depending jobs, if any (unless otherwise specified by the mode string)

func StopUnit

func StopUnit(name string, mode string) error

StopUnit stops the specified

func WriteUnitFile

func WriteUnitFile(filename string, templateName string, values ...string) error

WriteUnitFile writes an unit file

Types

type CreateRequest

type CreateRequest struct {
	Ns          string
	ID          string
	Name        string
	Description string
}

CreateRequest ...

type DeleteRequest

type DeleteRequest struct {
	Name string
}

DeleteRequest ...

type Response

type Response int

Response ...

type Service

type Service int

Service ...

func (*Service) CreateService

func (s *Service) CreateService(req CreateRequest, resp *Response) error

CreateService ...

func (*Service) DeleteUnitFile

func (s *Service) DeleteUnitFile(req DeleteRequest, resp *Response) error

DeleteUnitFile deletes the given unit file

func (*Service) GetStatus

func (s *Service) GetStatus(req UnitRequest, status *dbus.UnitStatus) error

GetStatus returns status information of the given unit

func (*Service) SwitchServiceState

func (s *Service) SwitchServiceState(req StateRequest, resp *Response) error

SwitchServiceState enables/disables the given unit

func (*Service) Upgrade

func (s *Service) Upgrade(req UpgradeRequest, resp *Response) error

Upgrade upgrades systemd and containerd

type StateRequest

type StateRequest struct {
	Name    string
	Enabled bool
	Active  bool
}

StateRequest ...

type UnitRequest

type UnitRequest struct {
	Name string
}

UnitRequest ...

type UpgradeRequest

type UpgradeRequest struct {
	Hostname     string
	MountOptions string
}

UpgradeRequest ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL