api

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func GetDistributors() ([]string, error)

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

func SaveDistributor(id string) error

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

func TryUnregister(instance string) error

TryUnregister attempts unregister, results are returned through callback any error returned is before unregister requested from dbus

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL