cloudinit/src/github.com/guelfey/go.dbus/_examples/introspect.go

22 lines
398 B
Go
Raw Normal View History

2014-03-05 04:40:35 +04:00
package main
import (
"encoding/json"
"github.com/guelfey/go.dbus"
"github.com/guelfey/go.dbus/introspect"
"os"
)
func main() {
conn, err := dbus.SessionBus()
if err != nil {
panic(err)
}
node, err := introspect.Call(conn.Object("org.freedesktop.DBus", "/org/freedesktop/DBus"))
if err != nil {
panic(err)
}
data, _ := json.MarshalIndent(node, "", " ")
os.Stdout.Write(data)
}