var ErrMsgInvalidArg … var ErrMsgNoObject … var ErrMsgUnknownMethod … var ErrMsgUnknownInterface … func MakeNoObjectError(path ObjectPath) Error { … } func MakeUnknownMethodError(methodName string) Error { … } func MakeUnknownInterfaceError(ifaceName string) Error { … } func MakeFailedError(err error) *Error { … } type Sender … func computeMethodName(name string, mapping map[string]string) string { … } func getMethods(in interface{ … } func getAllMethods(in interface{ … } func standardMethodArgumentDecode(m Method, sender string, msg *Message, body []interface{ … } func (conn *Conn) decodeArguments(m Method, sender string, msg *Message) ([]interface{ … } // handleCall handles the given method call (i.e. looks if it's one of the // pre-implemented ones and searches for a corresponding handler if not). func (conn *Conn) handleCall(msg *Message) { … } // Emit emits the given signal on the message bus. The name parameter must be // formatted as "interface.member", e.g., "org.freedesktop.DBus.NameLost". func (conn *Conn) Emit(path ObjectPath, name string, values ...interface{ … } // Export registers the given value to be exported as an object on the // message bus. // // If a method call on the given path and interface is received, an exported // method with the same name is called with v as the receiver if the // parameters match and the last return value is of type *Error. If this // *Error is not nil, it is sent back to the caller as an error. // Otherwise, a method reply is sent with the other return values as its body. // // Any parameters with the special type Sender are set to the sender of the // dbus message when the method is called. Parameters of this type do not // contribute to the dbus signature of the method (i.e. the method is exposed // as if the parameters of type Sender were not there). // // Similarly, any parameters with the type Message are set to the raw message // received on the bus. Again, parameters of this type do not contribute to the // dbus signature of the method. // // Every method call is executed in a new goroutine, so the method may be called // in multiple goroutines at once. // // Method calls on the interface org.freedesktop.DBus.Peer will be automatically // handled for every object. // // Passing nil as the first parameter will cause conn to cease handling calls on // the given combination of path and interface. // // Export returns an error if path is not a valid path name. func (conn *Conn) Export(v interface{ … } // ExportAll registers all exported methods defined by the given object on // the message bus. // // Unlike Export there is no requirement to have the last parameter as type // *Error. If you want to be able to return error then you can append an error // type parameter to your method signature. If the error returned is not nil, // it is sent back to the caller as an error. Otherwise, a method reply is // sent with the other return values as its body. func (conn *Conn) ExportAll(v interface{ … } // ExportWithMap works exactly like Export but provides the ability to remap // method names (e.g. export a lower-case method). // // The keys in the map are the real method names (exported on the struct), and // the values are the method names to be exported on DBus. func (conn *Conn) ExportWithMap(v interface{ … } // ExportSubtree works exactly like Export but registers the given value for // an entire subtree rather under the root path provided. // // In order to make this useful, one parameter in each of the value's exported // methods should be a Message, in which case it will contain the raw message // (allowing one to get access to the path that caused the method to be called). // // Note that more specific export paths take precedence over less specific. For // example, a method call using the ObjectPath /foo/bar/baz will call a method // exported on /foo/bar before a method exported on /foo. func (conn *Conn) ExportSubtree(v interface{ … } // ExportSubtreeWithMap works exactly like ExportSubtree but provides the // ability to remap method names (e.g. export a lower-case method). // // The keys in the map are the real method names (exported on the struct), and // the values are the method names to be exported on DBus. func (conn *Conn) ExportSubtreeWithMap(v interface{ … } // ExportMethodTable like Export registers the given methods as an object // on the message bus. Unlike Export the it uses a method table to define // the object instead of a native go object. // // The method table is a map from method name to function closure // representing the method. This allows an object exported on the bus to not // necessarily be a native go object. It can be useful for generating exposed // methods on the fly. // // Any non-function objects in the method table are ignored. func (conn *Conn) ExportMethodTable(methods map[string]interface{ … } // Like ExportSubtree, but with the same caveats as ExportMethodTable. func (conn *Conn) ExportSubtreeMethodTable(methods map[string]interface{ … } func (conn *Conn) exportMethodTable(methods map[string]interface{ … } func (conn *Conn) unexport(h *defaultHandler, path ObjectPath, iface string) error { … } // export is the worker function for all exports/registrations. func (conn *Conn) export(methods map[string]reflect.Value, path ObjectPath, iface string, includeSubtree bool) error { … } // ReleaseName calls org.freedesktop.DBus.ReleaseName and awaits a response. func (conn *Conn) ReleaseName(name string) (ReleaseNameReply, error) { … } // RequestName calls org.freedesktop.DBus.RequestName and awaits a response. func (conn *Conn) RequestName(name string, flags RequestNameFlags) (RequestNameReply, error) { … } type ReleaseNameReply … const ReleaseNameReplyReleased … const ReleaseNameReplyNonExistent … const ReleaseNameReplyNotOwner … type RequestNameFlags … const NameFlagAllowReplacement … const NameFlagReplaceExisting … const NameFlagDoNotQueue … type RequestNameReply … const RequestNameReplyPrimaryOwner … const RequestNameReplyInQueue … const RequestNameReplyExists … const RequestNameReplyAlreadyOwner …