pushgateway

package
v1.1.37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Notify sends a notification to the gateway at the given URL.
	Notify(ctx context.Context, url string, req *NotifyRequest, resp *NotifyResponse) error
}

A Client is how interactions with a Push Gateway is done.

func NewHTTPClient

func NewHTTPClient(disableTLSValidation bool) Client

NewHTTPClient creates a new Push Gateway client.

type Counts

type Counts struct {
	MissedCalls int `json:"missed_calls,omitempty"`
	Unread      int `json:"unread"` // TODO: UNSPEC: the spec says zero must be omitted, but Sytest 61push/01message-pushed.pl requires it.
}

type Device

type Device struct {
	AppID     string                 `json:"app_id"`  // Required
	Data      map[string]interface{} `json:"data"`    // Required. UNSPEC: Sytests require this to allow unknown keys.
	PushKey   string                 `json:"pushkey"` // Required
	PushKeyTS int64                  `json:"pushkey_ts,omitempty"`
	Tweaks    map[string]interface{} `json:"tweaks,omitempty"`
}

type Notification

type Notification struct {
	Content           json.RawMessage `json:"content,omitempty"`
	Counts            *Counts         `json:"counts,omitempty"`
	Devices           []*Device       `json:"devices"` // Required
	EventID           string          `json:"event_id,omitempty"`
	ID                string          `json:"id,omitempty"`         // Deprecated name for EventID.
	Membership        string          `json:"membership,omitempty"` // UNSPEC: required for Sytest.
	Prio              Prio            `json:"prio,omitempty"`
	RoomAlias         string          `json:"room_alias,omitempty"`
	RoomID            string          `json:"room_id,omitempty"`
	RoomName          string          `json:"room_name,omitempty"`
	Sender            string          `json:"sender,omitempty"`
	SenderDisplayName string          `json:"sender_display_name,omitempty"`
	Title             string          `json:"title,omitempty"`
	NotificationTitle string          `json:"notification_title,omitempty"`
	RoomType          string          `json:"room_type,omitempty"`
	PushType          string          `json:"push_type,omitempty"`
	CallID            string          `json:"call_id,omitempty"`
	CallKind          string          `json:"call_kind,omitempty"`
	ChannelKind       string          `json:"channel_kind,omitempty"`
	SuppressPush      bool            `json:"suppress_push,omitempty"`
	Type              string          `json:"type,omitempty"`
	UserIsTarget      bool            `json:"user_is_target,omitempty"`
}

type NotifyRequest

type NotifyRequest struct {
	Notification Notification `json:"notification"` // Required
}

type NotifyResponse

type NotifyResponse struct {
	// Rejected is the list of device push keys that were rejected
	// during the push. The caller should remove the push keys so they
	// are not used again.
	Rejected []string `json:"rejected"` // Required
}

type Prio

type Prio string
const (
	HighPrio Prio = "high"
	LowPrio  Prio = "low"
)

Jump to

Keyboard shortcuts

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