Versions in this module Expand all Collapse all v0 v0.1.0 Nov 12, 2022 v0.0.1 Nov 10, 2022 Changes in this version + const PrerequisiteTarget + const ServicesTarget + const SocketsTarget + const TimersTarget + const UserServicesTarget + var Version = getVersion + func Available() error + func EnsureAtLeast(requiredVersion int) error + func EscapeUnitNamePath(in string) string + func ExistingMountUnitPath(mountPointDir string) string + func IsSystemdTooOld(err error) bool + func MockJournalctl(f func(svcs []string, n int, follow, namespaces bool) (io.ReadCloser, error)) func() + func MockNewSystemd(f func(be Backend, rootDir string, mode InstanceMode, rep Reporter) Systemd) func() + func MockStopDelays(checkDelay, notifyDelay time.Duration) func() + func MockSystemctl(f func(args ...string) ([]byte, error)) func() + func MockSystemctlWithDelay(f func(args ...string) ([]byte, time.Duration, error)) func() + func MockSystemdSysctl(f func(args ...string) error) func() + func MockSystemdVersion(version int, injectedError error) (restore func()) + func MountUnitPath(baseDir string) string + func MountUnitPathWithLifetime(lifetime UnitLifetime, mountPointDir string) string + func NewJournalStreamFile(identifier string, priority syslog.Priority, levelPrefix bool) (*os.File, error) + func SdNotify(notifyState string) error + func Sysctl(prefixes []string) error + type Backend int + const EmulationModeBackend + const RunningSystemdBackend + type Error struct + func (e *Error) Error() string + func (e *Error) ExitCode() int + func (e *Error) Msg() []byte + type InstanceMode int + const GlobalUserMode + const SystemMode + const UserMode + type KeyringMode string + const KeyringModeInherit + const KeyringModePrivate + const KeyringModeShared + type Log map[string]*json.RawMessage + func (l Log) Message() string + func (l Log) PID() string + func (l Log) SID() string + func (l Log) Time() (time.Time, error) + type MountUnitOptions struct + Fstype string + Lifetime UnitLifetime + Options []string + Origin string + Revision string + SnapName string + What string + Where string + type Reporter interface + Notify func(string) + type RunOptions struct + KeyringMode KeyringMode + Stdin io.Reader + type Systemd interface + AddMountUnitFile func(name, revision, what, where, fstype string) (string, error) + AddMountUnitFileWithOptions func(unitOptions *MountUnitOptions) (string, error) + Backend func() Backend + CurrentMemoryUsage func(unit string) (quantity.Size, error) + CurrentTasksCount func(unit string) (uint64, error) + DaemonReexec func() error + DaemonReload func() error + DisableNoReload func(services []string) error + EnableNoReload func(services []string) error + InactiveEnterTimestamp func(unit string) (time.Time, error) + IsActive func(service string) (bool, error) + IsEnabled func(service string) (bool, error) + Kill func(service, signal, who string) error + ListMountUnits func(snapName, origin string) ([]string, error) + LogReader func(services []string, n int, follow, namespaces bool) (io.ReadCloser, error) + Mask func(service string) error + Mount func(what, where string, options ...string) error + ReloadOrRestart func(service string) error + RemoveMountUnitFile func(baseDir string) error + Restart func(services []string) error + RestartAll func(service string) error + Run func(command []string, opts *RunOptions) ([]byte, error) + Start func(service []string) error + StartNoBlock func(service []string) error + Status func(units []string) ([]*UnitStatus, error) + Stop func(services []string) error + Umount func(whatOrWhere string) error + Unmask func(service string) error + func New(mode InstanceMode, rep Reporter) Systemd + func NewEmulationMode(rootDir string) Systemd + func NewUnderRoot(rootDir string, mode InstanceMode, rep Reporter) Systemd + type UnitLifetime int + const Persistent + const Transient + type UnitStatus struct + Active bool + Daemon string + Enabled bool + Id string + Installed bool + Name string + Names []string + NeedDaemonReload bool