push

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotificationInit

func NotificationInit()

func PushHelperProcess

func PushHelperProcess()

run as the application push helper

func PushHelperProcessMessage

func PushHelperProcessMessage(in io.Reader, out io.Writer) error

Types

type AppMessage

type AppMessage struct {
	Notification AppMessageNotification `json:"notification"`
}

type AppMessageCard

type AppMessageCard struct {
	Summary   string   `json:"summary"`
	Body      string   `json:"body"`
	Actions   []string `json:"actions"`
	Popup     bool     `json:"popup"`
	Persist   bool     `json:"persist"`
	Timestamp int64    `json:"timestamp"`
}

type AppMessageEmblemCounter

type AppMessageEmblemCounter struct {
	Count   int  `json:"count"`
	Visible bool `json:"visible"`
}

type AppMessageNotification

type AppMessageNotification struct {
	Tag           string                  `json:"tag"`
	Card          AppMessageCard          `json:"card"`
	Sound         bool                    `json:"sound"`
	Vibrate       bool                    `json:"vibrate"`
	EmblemCounter AppMessageEmblemCounter `json:"emblem-counter"`
}

type Card

type Card struct {
	// Summary is a required title. The card will not be presented if this is missing.
	Summary string `json:"summary"`
	// Body is the longer text.
	Body string `json:"body,omitempty"`
	// Whether to show a bubble. Users can disable this, and can easily miss
	// them, so don’t rely on it exclusively.
	Popup bool `json:"popup,omitempty"`
	// Actions provides actions for the bubble's snap decissions.
	Actions []string `json:"actions,omitempty"`
	// Icon is a path to an icon to display with the notification bubble.
	Icon string `json:"icon,omitempty"`
	// Whether to show in notification centre.
	Persist   bool  `json:"persist,omitempty"`
	Timestamp int64 `json:"timestamp"`
}

Card is part of a notification and represents the user visible hints for a specific notification.

type Notification

type Notification struct {
	Card         *Card           `json:"card,omitempty"`
	RawSound     json.RawMessage `json:"sound"`
	RawVibration json.RawMessage `json:"vibrate"`
	Tag          string          `json:"tag,omitempty"`
}

Notification (optional) describes the user-facing notifications triggered by this push message.

type NotificationHandler

type NotificationHandler struct {
	// contains filtered or unexported fields
}
var (
	Nh *NotificationHandler
)

func NewLegacyHandler

func NewLegacyHandler(conn *dbus.Connection, application string) *NotificationHandler

func (*NotificationHandler) Clear added in v0.8.0

func (n *NotificationHandler) Clear(tag int64) error

func (*NotificationHandler) NewStandardPushMessage

func (n *NotificationHandler) NewStandardPushMessage(summary, body, icon string, tag string) *PushMessage

NewStandardPushMessage creates a base Notification with common components (members) setup.

func (*NotificationHandler) Send

Send sends a push notification to the system after running some checks

type PushMessage

type PushMessage struct {
	// Notification (optional) describes the user-facing notifications
	// triggered by this push message.
	Notification Notification `json:"notification,omitempty"`
	Message      string       `json:"message,omitempty"`
}

PushMessage represents a data structure to be sent over to the Post Office. It consists of a Notification and a Message.

type VariantMap

type VariantMap map[string]dbus.Variant

Jump to

Keyboard shortcuts

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