var systemBus … var systemBusLck … var sessionBus … var sessionBusLck … var ErrClosed … type Conn … // SessionBus returns a shared connection to the session bus, connecting to it // if not already done. func SessionBus() (conn *Conn, err error) { … } func getSessionBusAddress(autolaunch bool) (string, error) { … } // SessionBusPrivate returns a new private connection to the session bus. func SessionBusPrivate(opts ...ConnOption) (*Conn, error) { … } // SessionBusPrivate returns a new private connection to the session bus. If // the session bus is not already open, do not attempt to launch it. func SessionBusPrivateNoAutoStartup(opts ...ConnOption) (*Conn, error) { … } // SessionBusPrivate returns a new private connection to the session bus. // // Deprecated: use SessionBusPrivate with options instead. func SessionBusPrivateHandler(handler Handler, signalHandler SignalHandler) (*Conn, error) { … } // SystemBus returns a shared connection to the system bus, connecting to it if // not already done. func SystemBus() (conn *Conn, err error) { … } // ConnectSessionBus connects to the session bus. func ConnectSessionBus(opts ...ConnOption) (*Conn, error) { … } // ConnectSystemBus connects to the system bus. func ConnectSystemBus(opts ...ConnOption) (*Conn, error) { … } // Connect connects to the given address. // // Returned connection is ready to use and doesn't require calling // Auth and Hello methods to make it usable. func Connect(address string, opts ...ConnOption) (*Conn, error) { … } // SystemBusPrivate returns a new private connection to the system bus. // Note: this connection is not ready to use. One must perform Auth and Hello // on the connection before it is usable. func SystemBusPrivate(opts ...ConnOption) (*Conn, error) { … } // SystemBusPrivateHandler returns a new private connection to the system bus, using the provided handlers. // // Deprecated: use SystemBusPrivate with options instead. func SystemBusPrivateHandler(handler Handler, signalHandler SignalHandler) (*Conn, error) { … } // Dial establishes a new private connection to the message bus specified by address. func Dial(address string, opts ...ConnOption) (*Conn, error) { … } // DialHandler establishes a new private connection to the message bus specified by address, using the supplied handlers. // // Deprecated: use Dial with options instead. func DialHandler(address string, handler Handler, signalHandler SignalHandler) (*Conn, error) { … } type ConnOption … // WithHandler overrides the default handler. func WithHandler(handler Handler) ConnOption { … } // WithSignalHandler overrides the default signal handler. func WithSignalHandler(handler SignalHandler) ConnOption { … } // WithSerialGenerator overrides the default signals generator. func WithSerialGenerator(gen SerialGenerator) ConnOption { … } // WithAuth sets authentication methods for the auth conversation. func WithAuth(methods ...Auth) ConnOption { … } type Interceptor … // WithIncomingInterceptor sets the given interceptor for incoming messages. func WithIncomingInterceptor(interceptor Interceptor) ConnOption { … } // WithOutgoingInterceptor sets the given interceptor for outgoing messages. func WithOutgoingInterceptor(interceptor Interceptor) ConnOption { … } // WithContext overrides the default context for the connection. func WithContext(ctx context.Context) ConnOption { … } // NewConn creates a new private *Conn from an already established connection. func NewConn(conn io.ReadWriteCloser, opts ...ConnOption) (*Conn, error) { … } // NewConnHandler creates a new private *Conn from an already established connection, using the supplied handlers. // // Deprecated: use NewConn with options instead. func NewConnHandler(conn io.ReadWriteCloser, handler Handler, signalHandler SignalHandler) (*Conn, error) { … } // newConn creates a new *Conn from a transport. func newConn(tr transport, opts ...ConnOption) (*Conn, error) { … } // BusObject returns the object owned by the bus daemon which handles // administrative requests. func (conn *Conn) BusObject() BusObject { … } // Close closes the connection. Any blocked operations will return with errors // and the channels passed to Eavesdrop and Signal are closed. This method must // not be called on shared connections. func (conn *Conn) Close() error { … } // Context returns the context associated with the connection. The // context will be cancelled when the connection is closed. func (conn *Conn) Context() context.Context { … } // Connected returns whether conn is connected func (conn *Conn) Connected() bool { … } // Eavesdrop causes conn to send all incoming messages to the given channel // without further processing. Method replies, errors and signals will not be // sent to the appropriate channels and method calls will not be handled. If nil // is passed, the normal behaviour is restored. // // The caller has to make sure that ch is sufficiently buffered; // if a message arrives when a write to ch is not possible, the message is // discarded. func (conn *Conn) Eavesdrop(ch chan<- *Message) { … } // getSerial returns an unused serial. func (conn *Conn) getSerial() uint32 { … } // Hello sends the initial org.freedesktop.DBus.Hello call. This method must be // called after authentication, but before sending any other messages to the // bus. Hello must not be called for shared connections. func (conn *Conn) Hello() error { … } // inWorker runs in an own goroutine, reading incoming messages from the // transport and dispatching them appropriately. func (conn *Conn) inWorker() { … } func (conn *Conn) handleSignal(sequence Sequence, msg *Message) { … } // Names returns the list of all names that are currently owned by this // connection. The slice is always at least one element long, the first element // being the unique name of the connection. func (conn *Conn) Names() []string { … } // Object returns the object identified by the given destination name and path. func (conn *Conn) Object(dest string, path ObjectPath) BusObject { … } func (conn *Conn) sendMessageAndIfClosed(msg *Message, ifClosed func()) { … } func (conn *Conn) handleSendError(msg *Message, err error) { … } // Send sends the given message to the message bus. You usually don't need to // use this; use the higher-level equivalents (Call / Go, Emit and Export) // instead. If msg is a method call and NoReplyExpected is not set, a non-nil // call is returned and the same value is sent to ch (which must be buffered) // once the call is complete. Otherwise, ch is ignored and a Call structure is // returned of which only the Err member is valid. func (conn *Conn) Send(msg *Message, ch chan *Call) *Call { … } // SendWithContext acts like Send but takes a context func (conn *Conn) SendWithContext(ctx context.Context, msg *Message, ch chan *Call) *Call { … } func (conn *Conn) send(ctx context.Context, msg *Message, ch chan *Call) *Call { … } // sendError creates an error message corresponding to the parameters and sends // it to conn.out. func (conn *Conn) sendError(err error, dest string, serial uint32) { … } // sendReply creates a method reply message corresponding to the parameters and // sends it to conn.out. func (conn *Conn) sendReply(dest string, serial uint32, values ...interface{ … } // AddMatchSignal registers the given match rule to receive broadcast // signals based on their contents. func (conn *Conn) AddMatchSignal(options ...MatchOption) error { … } // AddMatchSignalContext acts like AddMatchSignal but takes a context. func (conn *Conn) AddMatchSignalContext(ctx context.Context, options ...MatchOption) error { … } // RemoveMatchSignal removes the first rule that matches previously registered with AddMatchSignal. func (conn *Conn) RemoveMatchSignal(options ...MatchOption) error { … } // RemoveMatchSignalContext acts like RemoveMatchSignal but takes a context. func (conn *Conn) RemoveMatchSignalContext(ctx context.Context, options ...MatchOption) error { … } // Signal registers the given channel to be passed all received signal messages. // // Multiple of these channels can be registered at the same time. The channel is // closed if the Conn is closed; it should not be closed by the caller before // RemoveSignal was called on it. // // These channels are "overwritten" by Eavesdrop; i.e., if there currently is a // channel for eavesdropped messages, this channel receives all signals, and // none of the channels passed to Signal will receive any signals. // // Panics if the signal handler is not a `SignalRegistrar`. func (conn *Conn) Signal(ch chan<- *Signal) { … } // RemoveSignal removes the given channel from the list of the registered channels. // // Panics if the signal handler is not a `SignalRegistrar`. func (conn *Conn) RemoveSignal(ch chan<- *Signal) { … } // SupportsUnixFDs returns whether the underlying transport supports passing of // unix file descriptors. If this is false, method calls containing unix file // descriptors will return an error and emitted signals containing them will // not be sent. func (conn *Conn) SupportsUnixFDs() bool { … } type Error … func NewError(name string, body []interface{ … } func (e Error) Error() string { … } type Signal … type transport … var transports … func getTransport(address string) (transport, error) { … } // getKey gets a key from a the list of keys. Returns "" on error / not found... func getKey(s, key string) string { … } type outputHandler … func (h *outputHandler) sendAndIfClosed(msg *Message, ifClosed func()) error { … } func (h *outputHandler) close() { … } type serialGenerator … func newSerialGenerator() *serialGenerator { … } func (gen *serialGenerator) GetSerial() uint32 { … } func (gen *serialGenerator) RetireSerial(serial uint32) { … } type nameTracker … func newNameTracker() *nameTracker { … } func (tracker *nameTracker) acquireUniqueConnectionName(name string) { … } func (tracker *nameTracker) acquireName(name string) { … } func (tracker *nameTracker) loseName(name string) { … } func (tracker *nameTracker) uniqueNameIsKnown() bool { … } func (tracker *nameTracker) isKnownName(name string) bool { … } func (tracker *nameTracker) listKnownNames() []string { … } type callTracker … func newCallTracker() *callTracker { … } func (tracker *callTracker) track(sn uint32, call *Call) { … } func (tracker *callTracker) handleReply(sequence Sequence, msg *Message) uint32 { … } func (tracker *callTracker) handleDBusError(sequence Sequence, msg *Message) uint32 { … } func (tracker *callTracker) handleSendError(msg *Message, err error) { … } // finalize was the only func that did not strobe Done func (tracker *callTracker) finalize(sn uint32) { … } func (tracker *callTracker) finalizeWithBody(sn uint32, sequence Sequence, body []interface{ … } func (tracker *callTracker) finalizeWithError(sn uint32, sequence Sequence, err error) { … } func (tracker *callTracker) finalizeAllWithError(sequenceGen *sequenceGenerator, err error) { … }