Documentation
¶
Overview ¶
Package push adapts the long-lived FCM connection to Ring's account-scoped API.
Index ¶
- func NewRegistrationTransport(next http.RoundTripper) http.RoundTripper
- func Start(ctx context.Context, saved json.RawMessage) (<-chan Event, error)
- func StartWithHTTPTransport(ctx context.Context, saved json.RawMessage, transport http.RoundTripper) (<-chan Event, error)
- func StartWithTransports(ctx context.Context, saved json.RawMessage, transport http.RoundTripper, ...) (<-chan Event, error)
- type DialContextFunc
- type Event
- type Kind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRegistrationTransport ¶
func NewRegistrationTransport(next http.RoundTripper) http.RoundTripper
NewRegistrationTransport validates every outbound FCM HTTP route and applies the known registration compatibility transformations before forwarding it.
func Start ¶
Start opens one FCM receiver. Credentials are caller-owned and can be persisted between runs; the receiver itself owns no Ring account state.
func StartWithHTTPTransport ¶ added in v0.5.0
func StartWithHTTPTransport( ctx context.Context, saved json.RawMessage, transport http.RoundTripper, ) (<-chan Event, error)
StartWithHTTPTransport opens one FCM receiver using the supplied HTTP transport. A nil transport uses the standard HTTP transport.
func StartWithTransports ¶ added in v0.5.0
func StartWithTransports( ctx context.Context, saved json.RawMessage, transport http.RoundTripper, dialContext DialContextFunc, ) (<-chan Event, error)
StartWithTransports opens the FCM receiver with injectable HTTP and MCS transports. The dial context function must return a connection ready for MCS frames; nil uses the receiver's TLS dialer.
Types ¶
type DialContextFunc ¶ added in v0.5.0
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.