fake

package
v1.88.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action is an int type alias.

const (
	// ActionDaemonReload is constant for the 'DaemonReload' action.
	ActionDaemonReload Action = iota
	// ActionDisable is constant for the 'Disable' action.
	ActionDisable
	// ActionEnable is constant for the 'Enable' action.
	ActionEnable
	// ActionRestart is constant for the 'Restart' action.
	ActionRestart
	// ActionStart is constant for the 'Start' action.
	ActionStart
	// ActionStop is constant for the 'Stop' action.
	ActionStop
	// ActionReboot is constant for the 'Reboot' action.
	ActionReboot
)

type DBus

type DBus struct {
	Actions []SystemdAction
	// contains filtered or unexported fields
}

DBus is a fake implementation for the dbus.DBus interface.

func New

func New() *DBus

New returns a simple implementation of dbus.DBus which can be used to fake the dbus actions in unit tests.

func (*DBus) DaemonReload

func (d *DBus) DaemonReload(_ context.Context) error

DaemonReload implements dbus.DBus.

func (*DBus) Disable

func (d *DBus) Disable(_ context.Context, unitNames ...string) error

Disable implements dbus.DBus.

func (*DBus) Enable

func (d *DBus) Enable(_ context.Context, unitNames ...string) error

Enable implements dbus.DBus.

func (*DBus) Reboot added in v1.87.0

func (d *DBus) Reboot() error

Reboot implements dbus.DBus.

func (*DBus) Restart

func (d *DBus) Restart(_ context.Context, _ record.EventRecorder, _ runtime.Object, unitName string) error

Restart implements dbus.DBus.

func (*DBus) Start

func (d *DBus) Start(_ context.Context, _ record.EventRecorder, _ runtime.Object, unitName string) error

Start implements dbus.DBus.

func (*DBus) Stop

func (d *DBus) Stop(_ context.Context, _ record.EventRecorder, _ runtime.Object, unitName string) error

Stop implements dbus.DBus.

type SystemdAction

type SystemdAction struct {
	Action    Action
	UnitNames []string
}

SystemdAction is used for the implementation of the fake dbus.

Jump to

Keyboard shortcuts

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