bertypushrelay

package
v2.470.8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const ServicePushPayloadMax = 4096 // FIXME: find an appropriate value

Variables

This section is empty.

Functions

func InternalDecodeOpaqueReceiver

func InternalDecodeOpaqueReceiver(publicKey *[cryptoutil.KeySize]byte, privateKey *[cryptoutil.KeySize]byte, dispatchers map[string]PushDispatcher, receiver *pushtypes.PushServiceOpaqueReceiver) (*pushtypes.PushServiceReceiver, error)

func InternalEncryptPushPayloadForReceiver

func InternalEncryptPushPayloadForReceiver(privateKey *[cryptoutil.KeySize]byte, rawPayload, recipientPublicKey []byte) ([]byte, error)

func PushDispatcherKey

func PushDispatcherKey(tokenType pushtypes.PushServiceTokenType, bundleID string) string

func PushServiceGenerateDispatchers

func PushServiceGenerateDispatchers(dispatchers []PushDispatcher) (map[string]PushDispatcher, []*pushtypes.PushServiceSupportedTokenType, error)

Types

type PushDispatcher

type PushDispatcher interface {
	Dispatch(payload []byte, receiver *pushtypes.PushServiceReceiver) error
	BundleID() string
	TokenType() pushtypes.PushServiceTokenType
}

func PushDispatcherLoadAPNSCertificates

func PushDispatcherLoadAPNSCertificates(logger *zap.Logger, input *string) ([]PushDispatcher, error)

func PushDispatcherLoadFirebaseAPIKey

func PushDispatcherLoadFirebaseAPIKey(ctx context.Context, logger *zap.Logger, bundleInput, keys *string) ([]PushDispatcher, error)

PushDispatcherLoadFirebaseAPIKey creates the FCM clients. If the `GOOGLE_APPLICATION_CREDENTIALS` env var is set, it will be used to create only one client. Otherwise, the `keys` parameter will be used, formatted like app_id:api_key.json and comma-separated to create the corresponding clients.

type PushService

type PushService interface {
	pushtypes.PushServiceServer

	Close() error
}

func NewPushService

func NewPushService(privateKey *[cryptoutil.KeySize]byte, dispatchers []PushDispatcher, logger *zap.Logger) (PushService, error)

func PushServerForTests

func PushServerForTests(ctx context.Context, t testing.TB, dispatchers []PushDispatcher, logger *zap.Logger) (PushService, *[32]byte, string, context.CancelFunc)

Jump to

Keyboard shortcuts

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