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 MockSessionBus.
SystemBus is like dbus.SystemBus and is provided for completeness.
This function is mockable by either MockConnections or MockSystemBus.
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.
Types ¶
This section is empty.