introspect

package
v0.0.0-...-17244d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package introspect provides some utilities for dealing with the DBus introspection format.

Index

Constants

View Source
const (
	ExtendFieldI18nDir    = "com.deepin.DBus.I18n.Dir"
	ExtendFieldI18nDomain = "com.deepin.DBus.I18n.Domain"
	ExtendFieldNoReply    = "org.freedesktop.DBus.Method.NoReply"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationInfo

type AnnotationInfo struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

Annotation is an annotation in the introspection format.

type AnnotationInfos

type AnnotationInfos []AnnotationInfo

func (AnnotationInfos) FieldValue

func (annos AnnotationInfos) FieldValue(field string) (string, bool)

func (AnnotationInfos) I18nInfo

func (annos AnnotationInfos) I18nInfo() (string, string, bool)

type ArgInfo

type ArgInfo struct {
	Name        string           `xml:"name,attr,omitempty"`
	Type        string           `xml:"type,attr"`
	Direction   string           `xml:"direction,attr,omitempty"`
	Annotations []AnnotationInfo `xml:"annotation"`
}

Arg represents an argument of a method or a signal.

func (ArgInfo) I18nInfo

func (arg ArgInfo) I18nInfo() (string, string, bool)

type InterfaceInfo

type InterfaceInfo struct {
	Name        string           `xml:"name,attr"`
	Methods     []MethodInfo     `xml:"method"`
	Signals     []SignalInfo     `xml:"signal"`
	Properties  []PropertyInfo   `xml:"property"`
	Annotations []AnnotationInfo `xml:"annotation"`
}

Interface describes a DBus interface that is available on the message bus.

type MethodInfo

type MethodInfo struct {
	Name        string           `xml:"name,attr"`
	Args        []ArgInfo        `xml:"arg"`
	Annotations []AnnotationInfo `xml:"annotation"`
}

Method describes a Method on an Interface as retured by an introspection.

func (MethodInfo) NoReply

func (m MethodInfo) NoReply() bool

type NodeInfo

type NodeInfo struct {
	XMLName    xml.Name        `xml:"node"`
	Name       string          `xml:"name,attr,omitempty"`
	Interfaces []InterfaceInfo `xml:"interface"`
	Children   []NodeInfo      `xml:"node,omitempty"`
}

Node is the root element of an introspection.

func Parse

func Parse(reader io.Reader) (*NodeInfo, error)

type PropertyInfo

type PropertyInfo struct {
	Name        string           `xml:"name,attr"`
	Type        string           `xml:"type,attr"`
	Access      string           `xml:"access,attr"`
	Annotations []AnnotationInfo `xml:"annotation"`
}

Property describes a property of an Interface.

func (PropertyInfo) I18nInfo

func (prop PropertyInfo) I18nInfo() (string, string, bool)

type SignalInfo

type SignalInfo struct {
	Name        string           `xml:"name,attr"`
	Args        []ArgInfo        `xml:"arg"`
	Annotations []AnnotationInfo `xml:"annotation"`
}

Signal describes a Signal emitted on an Interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL