func NewConnection() (Systemd, error) { conn, err := dbus.New() if err != nil { return NewStubSystemd(), err } return conn, nil }
func NewEventListener() (*EventListener, error) { e := EventListener{} var err error e.conn, err = dbus.New() if err != nil { return nil, err } err = e.conn.Subscribe() if err != nil { return nil, err } e.lastEvent = make(map[containers.Identifier]EventType) return &e, nil }