~ubuntu-branches/ubuntu/vivid/juju-core/vivid-proposed

« back to all changes in this revision

Viewing changes to src/github.com/godbus/dbus/doc.go

  • Committer: Package Import Robot
  • Author(s): Curtis C. Hovey
  • Date: 2015-09-29 19:43:29 UTC
  • mfrom: (47.1.4 wily-proposed)
  • Revision ID: package-import@ubuntu.com-20150929194329-9y496tbic30hc7vp
Tags: 1.24.6-0ubuntu1~15.04.1
Backport of 1.24.6 from wily. (LP: #1500916, #1497087)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Package dbus implements bindings to the D-Bus message bus system.
 
3
 
 
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
 
8
value.
 
9
 
 
10
Conversion Rules
 
11
 
 
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:
 
15
 
 
16
     Go type     | D-Bus type
 
17
     ------------+-----------
 
18
     byte        | BYTE
 
19
     bool        | BOOLEAN
 
20
     int16       | INT16
 
21
     uint16      | UINT16
 
22
     int32       | INT32
 
23
     uint32      | UINT32
 
24
     int64       | INT64
 
25
     uint64      | UINT64
 
26
     float64     | DOUBLE
 
27
     string      | STRING
 
28
     ObjectPath  | OBJECT_PATH
 
29
     Signature   | SIGNATURE
 
30
     Variant     | VARIANT
 
31
     UnixFDIndex | UNIX_FD
 
32
 
 
33
Slices and arrays encode as ARRAYs of their element type.
 
34
 
 
35
Maps encode as DICTs, provided that their key type can be used as a key for
 
36
a DICT.
 
37
 
 
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
 
40
be skipped.
 
41
 
 
42
Pointers encode as the value they're pointed to.
 
43
 
 
44
Trying to encode any other type or a slice, map or struct containing an
 
45
unsupported type will result in an InvalidTypeError.
 
46
 
 
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.
 
51
 
 
52
Unix FD passing
 
53
 
 
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
 
60
UnixFDIndex.
 
61
 
 
62
*/
 
63
package dbus