package dbus
import "k8s.io/kubernetes/pkg/util/dbus"
Package dbus provides an injectable interface and implementations for D-Bus communication
Index ¶
- type Call
- type Connection
- type Fake
- func NewFake(systemBus *FakeConnection, sessionBus *FakeConnection) *Fake
- func (db *Fake) SessionBus() (Connection, error)
- func (db *Fake) SystemBus() (Connection, error)
- type FakeConnection
- func NewFakeConnection() *FakeConnection
- func (conn *FakeConnection) AddObject(name, path string, handler FakeHandler)
- func (conn *FakeConnection) BusObject() Object
- func (conn *FakeConnection) EmitSignal(name, path, iface, signal string, args ...interface{})
- func (conn *FakeConnection) Object(name, path string) Object
- func (conn *FakeConnection) SetBusObject(handler FakeHandler)
- func (conn *FakeConnection) Signal(ch chan<- *godbus.Signal)
- type FakeHandler
- type Interface
- type Object
Types ¶
type Call ¶
type Call interface { // Store returns a completed call's return values, or an error Store(retvalues ...interface{}) error }
Call represents a pending or completed D-Bus method call
type Connection ¶
type Connection interface { // Returns an Object representing the bus itself BusObject() Object // Object creates a representation of a remote D-Bus object Object(name, path string) Object // Signal registers or unregisters a channel to receive D-Bus signals Signal(ch chan<- *godbus.Signal) }
Connection represents a D-Bus connection
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
Fake is a simple fake Interface type.
func NewFake ¶
func NewFake(systemBus *FakeConnection, sessionBus *FakeConnection) *Fake
NewFake returns a new Interface which will fake talking to D-Bus
func (*Fake) SessionBus ¶
func (db *Fake) SessionBus() (Connection, error)
SessionBus is part of Interface
func (*Fake) SystemBus ¶
func (db *Fake) SystemBus() (Connection, error)
SystemBus is part of Interface
type FakeConnection ¶
type FakeConnection struct {
// contains filtered or unexported fields
}
FakeConnection represents a fake D-Bus connection
func NewFakeConnection ¶
func NewFakeConnection() *FakeConnection
NewFakeConnection returns a FakeConnection Interface
func (*FakeConnection) AddObject ¶
func (conn *FakeConnection) AddObject(name, path string, handler FakeHandler)
AddObject adds a handler for the Object at name and path
func (*FakeConnection) BusObject ¶
func (conn *FakeConnection) BusObject() Object
BusObject is part of the Connection interface
func (*FakeConnection) EmitSignal ¶
func (conn *FakeConnection) EmitSignal(name, path, iface, signal string, args ...interface{})
EmitSignal emits a signal on conn
func (*FakeConnection) Object ¶
func (conn *FakeConnection) Object(name, path string) Object
Object is part of the Connection interface
func (*FakeConnection) SetBusObject ¶
func (conn *FakeConnection) SetBusObject(handler FakeHandler)
SetBusObject sets the handler for the BusObject of conn
func (*FakeConnection) Signal ¶
func (conn *FakeConnection) Signal(ch chan<- *godbus.Signal)
Signal is part of the Connection interface
type FakeHandler ¶
FakeHandler is used to handle fake D-Bus method calls
type Interface ¶
type Interface interface { // SystemBus returns a connection to the system bus, connecting to it // first if necessary SystemBus() (Connection, error) // SessionBus returns a connection to the session bus, connecting to it // first if necessary SessionBus() (Connection, error) }
Interface is an interface that presents a subset of the godbus/dbus API. Use this when you want to inject fakeable/mockable D-Bus behavior.
func New ¶
func New() Interface
New returns a new Interface which will use godbus to talk to D-Bus
type Object ¶
type Object interface { // Call synchronously calls a D-Bus method Call(method string, flags godbus.Flags, args ...interface{}) Call }
Object represents a remote D-Bus object
Source Files ¶
dbus.go doc.go fake_dbus.go
- Version
- v1.14.6
- Published
- Aug 16, 2019
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 8 seconds ago –
Tools for package owners.