Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SessionBus = func() (*dbus.Conn, error) { if isSessionBusLikelyPresent() { return dbus.SessionBus() } return nil, fmt.Errorf("cannot find session bus") }
SessionBus is like dbus.SessionBus but it avoids auto-starting a new dbus-daemon when a bus is not already available.
The go-dbus package will launch a session bus instance on demand when none is present, something we do not want to do. In all contexts where there is a need
to use the session bus, we expect session bus daemon to have been started and
managed by the corresponding user session manager.
This function is mockable by either MockConnections or MockOnlySessionBusAvailable.
SystemBus is like dbus.SystemBus and is provided for completeness.
This function is mockable by either MockConnections or MockOnlySystemBusAvailable.
Functions ¶
func MockConnections ¶
MockConnections mocks the connection functions system and session buses.
func MockOnlySessionBusAvailable ¶
MockOnlySessionBusAvailable makes SessionBus return the given connection.
In addition calling SystemBus will panic.
func MockOnlySystemBusAvailable ¶
MockOnlySystemBusAvailable makes SystemBus return the given connection.
In addition calling SessionBus will panic.
func SessionBusPrivate ¶
SessionBusPrivate opens a connection to the D-Bus session bus independent of the default shared connection.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
netplantest provides a fake implementation of the netplan dbus API for testing.
|
netplantest provides a fake implementation of the netplan dbus API for testing. |