2
Package dbus implements bindings to the D-Bus message bus system.
4
To use the message bus API, you first need to connect to a bus (usually the
5
session or system bus). The acquired connection then can be used to call methods
6
on remote objects and emit or receive signals. Using the Export method, you can
7
arrange D-Bus methods calls to be directly translated to method calls on a Go
12
For outgoing messages, Go types are automatically converted to the
13
corresponding D-Bus types. The following types are directly encoded as their
14
respective D-Bus equivalents:
17
------------+-----------
28
ObjectPath | OBJECT_PATH
33
Slices and arrays encode as ARRAYs of their element type.
35
Maps encode as DICTs, provided that their key type can be used as a key for
38
Structs other than Variant and Signature encode as a STRUCT containing their
39
exported fields. Fields whose tags contain `dbus:"-"` and unexported fields will
42
Pointers encode as the value they're pointed to.
44
Trying to encode any other type or a slice, map or struct containing an
45
unsupported type will result in an InvalidTypeError.
47
For incoming messages, the inverse of these rules are used, with the exception
48
of STRUCTs. Incoming STRUCTS are represented as a slice of empty interfaces
49
containing the struct fields in the correct order. The Store function can be
50
used to convert such values to Go structs.
54
Handling Unix file descriptors deserves special mention. To use them, you should
55
first check that they are supported on a connection by calling SupportsUnixFDs.
56
If it returns true, all method of Connection will translate messages containing
57
UnixFD's to messages that are accompanied by the given file descriptors with the
58
UnixFD values being substituted by the correct indices. Similarily, the indices
59
of incoming messages are automatically resolved. It shouldn't be necessary to use