dbus

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dbus provides D-Bus clients for system services used by the supervisor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logind

type Logind interface {
	// PowerOff triggers an immediate system shutdown.
	PowerOff(ctx context.Context) error

	// Reboot triggers an immediate system reboot.
	Reboot(ctx context.Context) error
}

Logind controls system power state via the systemd-logind D-Bus interface. All operations are issued without an authentication prompt.

type RAUC

type RAUC interface {
	// Status returns the current system compatibility, boot slot, and the
	// state of all configured slots.
	Status(ctx context.Context) (RAUCStatus, error)

	// Install installs the bundle at filename. It blocks until RAUC signals
	// completion, so the caller should pass a context unaffected by client
	// disconnection if the installation must not be interrupted.
	Install(ctx context.Context, filename string) error
}

RAUC manages OS bundle installation via the RAUC D-Bus interface.

type RAUCSlot

type RAUCSlot struct {
	Name     string `json:"name"`
	Class    string `json:"class"`
	Device   string `json:"device"`
	Type     string `json:"type"`
	Bootname string `json:"bootname"`
	State    string `json:"state"`
	SHA256   string `json:"sha256,omitempty"`
	Size     uint64 `json:"size,omitempty"`
}

RAUCSlot describes the state of a single RAUC slot.

type RAUCStatus

type RAUCStatus struct {
	Compatible string     `json:"compatible"`
	Variant    string     `json:"variant"`
	BootSlot   string     `json:"booted"`
	Slots      []RAUCSlot `json:"slots"`
}

RAUCStatus describes the overall system status reported by RAUC.

type System

type System struct {
	// contains filtered or unexported fields
}

System holds D-Bus clients for system services and owns the underlying connection.

func New

func New() (*System, error)

New connects to the system D-Bus and returns a System ready for use. Call Close when the System is no longer needed.

func NewWithConn

func NewWithConn(conn *dbus.Conn) *System

NewWithConn returns a System using an existing D-Bus connection. It is intended for use in tests.

func (*System) Close

func (s *System) Close() error

Close closes the underlying D-Bus connection.

func (*System) Logind

func (s *System) Logind() Logind

Logind returns the logind D-Bus client.

func (*System) RAUC

func (s *System) RAUC() RAUC

RAUC returns the RAUC D-Bus client.

Jump to

Keyboard shortcuts

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