Categorygithub.com/beeper/push-receiver
modulepackage
0.0.0-20241029163002-9d9b7dd5d4f4
Repository: https://github.com/beeper/push-receiver.git
Documentation: pkg.go.dev

# README

go-push-receiver

GoDoc Go Report Card MIT License Github Actions

A library to subscribe to GCM/FCM and receive notifications.

This library was developed inspired by push-receiver (https://github.com/MatthieuLemoine/push-receiver/).

Build

  1. install protoc
brew install protobuf
  1. build
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
$ protoc -I=proto --go_out=pb/mcs proto/mcs.proto
$ protoc -I=proto --go_out=pb/checkin proto/checkin.proto
$ protoc -I=proto --go_out=pb/checkin proto/android_checkin.proto
$ go build

License

MIT License

proto file is licensed by is The Chromium Authors. (BSD-style license) (copied it from https://chromium.googlesource.com/chromium/chromium/+/trunk/google_apis/gcm/protocol/)

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
New returns a new FCM push receive client instance.
NewBackoff creates Backoff instance.
No description provided by the author
No description provided by the author
WithAdaptive is heartbeat adaptive setter.
WithBackoff is Backoff setter.
WithClientInterval is heartbeat client interval setter.
WithCreds is credentials setter.
WithDeadmanTimeout is heartbeat deadman timeout setter.
WithDialer is net.Dialer setter.
WithHeartbeat is Heartbeat setter.
WithHTTPClient is http.Client setter.
No description provided by the author
WithReceivedPersistentID is received persistentId list setter.
WithRetry configures whether to retry when an error occurs.
WithServerInterval is heartbeat server interval setter.
WithTLSConfig is tls.Config setter.

# Variables

ErrFcmNotEnoughData is error that data is not enough data from FCM.
ErrGcmAuthorization is authorization error of GCM.
ErrNotFoundInAppData is error that key not found in app data.

# Structs

Backoff with jitter sleep to prevent overloaded conditions during intervals https://www.awsarchitectureblog.com/2015/03/backoff.html.
ConnectedEvent is connection event.
DisconnectedEvent is disconnect event.
FCMCredentials is Credentials for FCM.
No description provided by the author
No description provided by the author
Heartbeat sends signal for connection keep alive.
HeartbeatError is send heartbeat error.
HeartbeatEvent is send/received heartbeat event.
No description provided by the author
MessageEvent is receive message event.
RetryEvent is disconnect event.
No description provided by the author
UnauthorizedError is unauthorization error.

# Interfaces

Event type.

# Type aliases

ClientOption type.
HeartbeatOption type.