Documentation ¶
Index ¶
- Variables
- func GetDistributor() string
- func GetDistributors() ([]string, error)
- func Initialize(name string, handler dbus.ConnectorHandler) error
- func InitializeAndCheck(name string, handler dbus.ConnectorHandler) error
- func Register(instance string) (registerStatus definitions.RegisterStatus, registrationFailReason string, ...)
- func RemoveDistributor() error
- func SaveDistributor(id string) error
- func TryUnregister(instance string) error
Constants ¶
This section is empty.
Variables ¶
var ErrInstanceNotUnregistered = errors.New("Instance isn't unregistered yet")
ErrInstanceNotUnregistered informs if instances are not unregistered when executing a distributor change method
Functions ¶
func GetDistributor ¶
func GetDistributor() string
GetDistributor returns current selected distributor or empty string
func GetDistributors ¶
GetDistributors lists all distributors that are available to register with (note the difference from GetDistributor singular)
func Initialize ¶
func Initialize(name string, handler dbus.ConnectorHandler) error
Initializes the bus and object
func InitializeAndCheck ¶
func InitializeAndCheck(name string, handler dbus.ConnectorHandler) error
InitializeAndCheck is a convienience method that handles initialization and checking whether app started in the background. The background check checks whether the argument UNIFIEDPUSH_DBUS_BACKGROUND_ACTIVATION is input. Listens for 3 seconds after the last message and then exits. if running in the background this panics on error
func Register ¶
func Register(instance string) (registerStatus definitions.RegisterStatus, registrationFailReason string, err error)
TryRegister registers a new instance. value of instance can be empty string for the default instance registration endpoint is returned through the callback if method is successful
func RemoveDistributor ¶
func RemoveDistributor() error
RemoveDistributor removes the currently set distributor all instances (registered to the previous distributor) have to unregister before running this
func SaveDistributor ¶
SaveDistributor saves the distributor preference to use for future registrations valid values are picked from the list returned by GetDistributors all instances (registered to the previous distributor) have to unregister before running this
func TryUnregister ¶
TryUnregister attempts unregister, results are returned through callback any error returned is before unregister requested from dbus
Types ¶
This section is empty.