dbus

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dbus provides a cross-platform abstraction for D-Bus communication. On Linux, it uses the godbus library. On other platforms, it provides no-op stubs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAvailable

func IsAvailable() bool

IsAvailable checks if D-Bus is available on this platform.

Types

type Connection

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

Connection represents a D-Bus connection.

func SessionBus

func SessionBus(ctx context.Context) (*Connection, error)

SessionBus connects to the session bus.

func SystemBus

func SystemBus(ctx context.Context) (*Connection, error)

SystemBus connects to the system bus.

func (*Connection) Close

func (c *Connection) Close() error

Close closes the D-Bus connection.

func (*Connection) ListNames

func (c *Connection) ListNames(ctx context.Context) ([]string, error)

ListNames lists all available names on the bus.

func (*Connection) Object

func (c *Connection) Object(dest, path string) *Object

Object gets a D-Bus object.

type Object

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

Object represents a D-Bus object.

func (*Object) Call

func (o *Object) Call(ctx context.Context, method string, args ...any) error

Call invokes a D-Bus method.

func (*Object) CallWithReturn

func (o *Object) CallWithReturn(ctx context.Context, method string, args ...any) ([]any, error)

CallWithReturn invokes a D-Bus method and returns the result.

func (*Object) GetProperty

func (o *Object) GetProperty(ctx context.Context, property string) (any, error)

GetProperty gets a D-Bus property.

func (*Object) SetProperty

func (o *Object) SetProperty(ctx context.Context, property string, value any) error

SetProperty sets a D-Bus property.

Jump to

Keyboard shortcuts

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