package introspect
import "github.com/godbus/dbus/v5/introspect"
Package introspect provides some utilities for dealing with the DBus introspection format.
Index ¶
- Constants
- Variables
- type Annotation
- type Arg
- type Interface
- type Introspectable
- func NewIntrospectable(n *Node) Introspectable
- func (i Introspectable) Introspect() (string, *dbus.Error)
- type Method
- type Node
- type Property
- type Signal
Constants ¶
const IntrospectDataString = "" /* 160 byte string literal not displayed */
The introspection data for the org.freedesktop.DBus.Introspectable interface, as a string.
const IntrospectDeclarationString = "" /* 149 byte string literal not displayed */
XML document type declaration of the introspection format version 1.0
Variables ¶
var IntrospectData = Interface{ Name: "org.freedesktop.DBus.Introspectable", Methods: []Method{ { Name: "Introspect", Args: []Arg{ {"out", "s", "out"}, }, }, }, }
The introspection data for the org.freedesktop.DBus.Introspectable interface.
Types ¶
type Annotation ¶
Annotation is an annotation in the introspection format.
type Arg ¶
type Arg struct { Name string `xml:"name,attr,omitempty"` Type string `xml:"type,attr"` Direction string `xml:"direction,attr,omitempty"` }
Arg represents an argument of a method or a signal.
type Interface ¶
type Interface struct { Name string `xml:"name,attr"` Methods []Method `xml:"method"` Signals []Signal `xml:"signal"` Properties []Property `xml:"property"` Annotations []Annotation `xml:"annotation"` }
Interface describes a DBus interface that is available on the message bus.
type Introspectable ¶
type Introspectable string
Introspectable implements org.freedesktop.Introspectable.
You can create it by converting the XML-formatted introspection data from a string to an Introspectable or call NewIntrospectable with a Node. Then, export it as org.freedesktop.Introspectable on you object.
func NewIntrospectable ¶
func NewIntrospectable(n *Node) Introspectable
NewIntrospectable returns an Introspectable that returns the introspection data that corresponds to the given Node. If n.Interfaces doesn't contain the data for org.freedesktop.DBus.Introspectable, it is added automatically.
func (Introspectable) Introspect ¶
func (i Introspectable) Introspect() (string, *dbus.Error)
Introspect implements org.freedesktop.Introspectable.Introspect.
type Method ¶
type Method struct { Name string `xml:"name,attr"` Args []Arg `xml:"arg"` Annotations []Annotation `xml:"annotation"` }
Method describes a Method on an Interface as retured by an introspection.
func Methods ¶
func Methods(v interface{}) []Method
Methods returns the description of the methods of v. This can be used to create a Node which can be passed to NewIntrospectable.
type Node ¶
type Node struct { XMLName xml.Name `xml:"node"` Name string `xml:"name,attr,omitempty"` Interfaces []Interface `xml:"interface"` Children []Node `xml:"node,omitempty"` }
Node is the root element of an introspection.
func Call ¶
Call calls org.freedesktop.Introspectable.Introspect on a remote object and returns the introspection data.
type Property ¶
type Property struct { Name string `xml:"name,attr"` Type string `xml:"type,attr"` Access string `xml:"access,attr"` Annotations []Annotation `xml:"annotation"` }
Property describes a property of an Interface.
type Signal ¶
type Signal struct { Name string `xml:"name,attr"` Args []Arg `xml:"arg"` Annotations []Annotation `xml:"annotation"` }
Signal describes a Signal emitted on an Interface.
Source Files ¶
call.go introspect.go introspectable.go
- Version
- v5.0.4
- Published
- Mar 23, 2021
- Platform
- darwin/amd64
- Imports
- 4 packages
- Last checked
- 4 hours ago –
Tools for package owners.