dbusx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dbusx holds the session-bus plumbing lys-shell's daemons share: exporting an interface under a well-known name the way zbus's object_server().at + request_name does, and serving zbus-style #[zbus(property)] getters (computed on every read) over org.freedesktop.DBus.Properties.

Index

Constants

View Source
const (
	ErrFailed          = "org.freedesktop.DBus.Error.Failed"
	ErrInvalidArgs     = "org.freedesktop.DBus.Error.InvalidArgs"
	ErrUnknownProperty = "org.freedesktop.DBus.Error.UnknownProperty"
	ErrUnknownIface    = "org.freedesktop.DBus.Error.UnknownInterface"
	ErrPropertyRO      = "org.freedesktop.DBus.Error.PropertyReadOnly"
)

Error names the Rust daemons reply with (zbus fdo::Error variants).

Variables

This section is empty.

Functions

func Export

func Export(conn *dbus.Conn, path dbus.ObjectPath, ifaces ...Interface) (unexport func(), err error)

Export puts ifaces at path on conn, with one Properties object serving all of their properties and introspection listing them all, as zbus's object_server().at does for each interface it mounts at a path. The returned unexport removes them again (a Request or Session object ending).

func Failed

func Failed(msg string) *dbus.Error

Failed is fdo::Error::Failed(msg).

func InvalidArgs

func InvalidArgs(msg string) *dbus.Error

InvalidArgs is fdo::Error::InvalidArgs(msg).

func Own

func Own(conn *dbus.Conn, name string) (func(), error)

Own takes a well-known name; the returned release drops it. A name already owned is an error, as zbus's request_name with DoNotQueue.

func Serve

func Serve(conn *dbus.Conn, s Service) (func(), error)

Serve exports s on conn and takes its well-known name; the returned release drops the name. A name already owned is an error, as zbus's request_name with DoNotQueue.

Types

type Getters

type Getters map[string]func() any

Getters maps property names to their read functions. Each returns a value godbus can marshal; the D-Bus signature is taken from it.

type Interface

type Interface struct {
	Name       string
	Methods    any
	Properties Getters
}

Interface is one D-Bus interface of an object: its methods (an object whose exported methods each end in a *dbus.Error result) and its read-only properties.

type Service

type Service struct {
	// Name is the well-known bus name and Path the object path.
	Name string
	Path dbus.ObjectPath
	// Interface is the D-Bus interface the methods are exported as.
	Interface string
	// Methods is the object whose exported methods (each ending in a
	// *dbus.Error result) form the interface.
	Methods any
	// Properties are the read-only properties.
	Properties Getters
}

Service is one exported interface.

Jump to

Keyboard shortcuts

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