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
- func Export(conn *dbus.Conn, path dbus.ObjectPath, ifaces ...Interface) (unexport func(), err error)
- func Failed(msg string) *dbus.Error
- func InvalidArgs(msg string) *dbus.Error
- func Own(conn *dbus.Conn, name string) (func(), error)
- func Serve(conn *dbus.Conn, s Service) (func(), error)
- type Getters
- type Interface
- type Service
Constants ¶
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 InvalidArgs ¶
InvalidArgs is fdo::Error::InvalidArgs(msg).
Types ¶
type Getters ¶
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 ¶
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.