mirror of
https://github.com/rancher/os.git
synced 2025-09-15 14:40:51 +00:00
move dependencies to vendor
This commit is contained in:
27
vendor/github.com/guelfey/go.dbus/introspect/call.go
generated
vendored
Normal file
27
vendor/github.com/guelfey/go.dbus/introspect/call.go
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package introspect
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"github.com/guelfey/go.dbus"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Call calls org.freedesktop.Introspectable.Introspect on a remote object
|
||||
// and returns the introspection data.
|
||||
func Call(o *dbus.Object) (*Node, error) {
|
||||
var xmldata string
|
||||
var node Node
|
||||
|
||||
err := o.Call("org.freedesktop.DBus.Introspectable.Introspect", 0).Store(&xmldata)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = xml.NewDecoder(strings.NewReader(xmldata)).Decode(&node)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if node.Name == "" {
|
||||
node.Name = string(o.Path())
|
||||
}
|
||||
return &node, nil
|
||||
}
|
Reference in New Issue
Block a user