push

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package push adapts the long-lived FCM connection to Ring's account-scoped API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRegistrationTransport

func NewRegistrationTransport(next http.RoundTripper) http.RoundTripper

NewRegistrationTransport applies the compatibility rules required by Ring's FCM registration before handing a request to the supplied transport.

func Start

func Start(ctx context.Context, saved json.RawMessage) (<-chan Event, error)

Start opens one FCM receiver. Credentials are caller-owned and can be persisted between runs; the receiver itself owns no Ring account state.

Types

type Event

type Event struct {
	Kind        Kind
	Token       string
	Credentials json.RawMessage
	Data        json.RawMessage
	Err         error
}

func TranslateEvent

func TranslateEvent(raw pushreceiver.Event) (Event, bool)

TranslateEvent maps third-party receiver events into this package's event shape.

type Kind

type Kind string
const (
	KindCredentials Kind = "credentials"
	KindConnected   Kind = "connected"
	KindMessage     Kind = "message"
	KindRetry       Kind = "retry"
	KindClosed      Kind = "closed"
)

Jump to

Keyboard shortcuts

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