...
1
2
3 package introspect
4
5 import "encoding/xml"
6
7
8 var IntrospectData = Interface{
9 Name: "org.freedesktop.DBus.Introspectable",
10 Methods: []Method{
11 {
12 Name: "Introspect",
13 Args: []Arg{
14 {"out", "s", "out"},
15 },
16 },
17 },
18 }
19
20
21 const IntrospectDeclarationString = `
22 <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
23 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
24 `
25
26
27
28 const IntrospectDataString = `
29 <interface name="org.freedesktop.DBus.Introspectable">
30 <method name="Introspect">
31 <arg name="out" direction="out" type="s"/>
32 </method>
33 </interface>
34 `
35
36
37 type Node struct {
38 XMLName xml.Name `xml:"node"`
39 Name string `xml:"name,attr,omitempty"`
40 Interfaces []Interface `xml:"interface"`
41 Children []Node `xml:"node,omitempty"`
42 }
43
44
45 type Interface struct {
46 Name string `xml:"name,attr"`
47 Methods []Method `xml:"method"`
48 Signals []Signal `xml:"signal"`
49 Properties []Property `xml:"property"`
50 Annotations []Annotation `xml:"annotation"`
51 }
52
53
54 type Method struct {
55 Name string `xml:"name,attr"`
56 Args []Arg `xml:"arg"`
57 Annotations []Annotation `xml:"annotation"`
58 }
59
60
61 type Signal struct {
62 Name string `xml:"name,attr"`
63 Args []Arg `xml:"arg"`
64 Annotations []Annotation `xml:"annotation"`
65 }
66
67
68 type Property struct {
69 Name string `xml:"name,attr"`
70 Type string `xml:"type,attr"`
71 Access string `xml:"access,attr"`
72 Annotations []Annotation `xml:"annotation"`
73 }
74
75
76 type Arg struct {
77 Name string `xml:"name,attr,omitempty"`
78 Type string `xml:"type,attr"`
79 Direction string `xml:"direction,attr,omitempty"`
80 }
81
82
83 type Annotation struct {
84 Name string `xml:"name,attr"`
85 Value string `xml:"value,attr"`
86 }
87
View as plain text