Help us shape the future of Go! Take the 2026 Go Developer Survey

dbus

package
v1.147.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBus

type DBus interface {
	// DaemonReload reload the systemd configuration, same as executing "systemctl daemon-reload".
	DaemonReload(ctx context.Context) error
	// Enable the given units, same as executing "systemctl enable unit".
	Enable(ctx context.Context, unitNames ...string) error
	// Disable the given units, same as executing "systemctl disable unit".
	Disable(ctx context.Context, unitNames ...string) error
	// Start the given unit and record an event to the node object, same as executing "systemctl start unit".
	Start(ctx context.Context, recorder events.EventRecorder, node runtime.Object, unitName string) error
	// Stop the given unit and record an event to the node object, same as executing "systemctl stop unit".
	Stop(ctx context.Context, recorder events.EventRecorder, node runtime.Object, unitName string) error
	// Restart the given unit and record an event to the node object, same as executing "systemctl restart unit".
	Restart(ctx context.Context, recorder events.EventRecorder, node runtime.Object, unitName string) error
	// List lists all units and returns the output.
	List(ctx context.Context) ([]dbus.UnitStatus, error)
	// ListByNames returns statuses for the specified units.
	ListByNames(ctx context.Context, unitNames []string) ([]dbus.UnitStatus, error)
	// GetUnitStateChangeTimestamp returns the wall-clock time when the unit last changed state.
	GetUnitStateChangeTimestamp(ctx context.Context, unitName string) (time.Time, error)
	// GetTriggeredBy returns the list of units that trigger the given unit (e.g., timer or path units).
	GetTriggeredBy(ctx context.Context, unitName string) ([]string, error)
	// GetServiceType returns the service type (e.g., "simple", "oneshot") for the given unit.
	GetServiceType(ctx context.Context, unitName string) (string, error)
	// Reboot this machines, is the same as executing "systemctl reboot".
	Reboot() error
}

DBus is an interface for interacting with systemd via dbus.

func New

func New(log logr.Logger) DBus

New returns a new working DBus

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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