bertypushrelay

package
v2.329.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0, MIT Imports: 25 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) (*protocoltypes.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 *protocoltypes.PushServiceReceiver) error
	BundleID() string
	TokenType() pushtypes.PushServiceTokenType
}

func PushDispatcherLoadAPNSCertificates

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

func PushDispatcherLoadFirebaseAPIKey

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

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