client

package
v0.0.0-...-2fed64a Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: GPL-3.0, GPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package client implements the Ubuntu Push Notifications client-side daemon.

Index

Constants

View Source
const (
	SI_NO_SERVICE_ERROR = "org.freedesktop.DBus.Error.ServiceUnknown: The name com.canonical.SystemImage was not provided by any .service files"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	connectivity.ConnectivityConfig // q.v.
	// A reasonably large timeout for receive/answer pairs
	ExchangeTimeout config.ConfigTimeDuration `json:"exchange_timeout"`
	// A timeout to use when trying to connect to the server
	ConnectTimeout config.ConfigTimeDuration `json:"connect_timeout"`
	// The server to connect to or url to query for hosts to connect to
	Addr string
	// Host list management
	HostsCachingExpiryTime config.ConfigTimeDuration `json:"hosts_cache_expiry"`  // potentially refresh host list after
	ExpectAllRepairedTime  config.ConfigTimeDuration `json:"expect_all_repaired"` // worth retrying all servers after
	// The PEM-encoded server certificate
	CertPEMFile     string `json:"cert_pem_file"`
	SessionURL      string `json:"session_url"`
	RegistrationURL string `json:"registration_url"`
	// The logging level (one of "debug", "info", "error")
	LogLevel logger.ConfigLogLevel `json:"log_level"`
	// fallback values for simplified notification usage
	FallbackVibration *launch_helper.Vibration `json:"fallback_vibration"`
	FallbackSound     string                   `json:"fallback_sound"`
	// times for the poller
	PollInterval    config.ConfigTimeDuration `json:"poll_interval"`
	PollSettle      config.ConfigTimeDuration `json:"poll_settle"`
	PollNetworkWait config.ConfigTimeDuration `json:"poll_net_wait"`
	PollPolldWait   config.ConfigTimeDuration `json:"poll_polld_wait"`
	PollDoneWait    config.ConfigTimeDuration `json:"poll_done_wait"`
	PollBusyWait    config.ConfigTimeDuration `json:"poll_busy_wait"`
}

ClientConfig holds the client configuration

type PostalService

type PostalService interface {
	// Starts the service
	Start() error
	// Post converts a push message into a presentable notification
	// and a postal message, presents the former and stores the
	// latter in the application's mailbox.
	Post(app *click.AppId, nid string, payload json.RawMessage)
	// IsRunning() returns whether the service is running
	IsRunning() bool
	// Stop() stops the service
	Stop()
}

type PushClient

type PushClient struct {
	// contains filtered or unexported fields
}

PushClient is the Ubuntu Push Notifications client-side daemon.

func NewPushClient

func NewPushClient(configPath string, leveldbPath string) *PushClient

Creates a new Ubuntu Push Notifications client-side daemon that will use the given configuration file.

func (*PushClient) CheckForAddressee

func (client *PushClient) CheckForAddressee(notif *protocol.Notification) *click.AppId

CheckForAddressee check for the addressee presence.

func (*PushClient) Loop

func (client *PushClient) Loop()

Loop calls doLoop with the "real" handlers

func (*PushClient) Start

func (client *PushClient) Start() error

Start calls doStart with the "real" starters

func (*PushClient) StartAddresseeBatch

func (client *PushClient) StartAddresseeBatch()

StartAddresseeBatch starts a batch of checks for addressees.

type PushService

type PushService interface {
	// Start starts the service.
	Start() error
	// Unregister unregisters the token for appId.
	Unregister(appId string) error
}

PushService is the interface we use of service.PushService.

Directories

Path Synopsis
Package gethosts implements finding hosts to connect to for delivery of notifications.
Package gethosts implements finding hosts to connect to for delivery of notifications.
package service implements the dbus-level service with which client applications are expected to interact.
package service implements the dbus-level service with which client applications are expected to interact.
Package session handles the minutiae of interacting with the Ubuntu Push Notifications server.
Package session handles the minutiae of interacting with the Ubuntu Push Notifications server.
seenstate
Package seenstate holds implementations of the SeenState that the client session uses to keep track of what messages it has seen.
Package seenstate holds implementations of the SeenState that the client session uses to keep track of what messages it has seen.

Jump to

Keyboard shortcuts

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