Documentation ¶
Index ¶
- Constants
- func InternalDecodeOpaqueReceiver(publicKey *[cryptoutil.KeySize]byte, privateKey *[cryptoutil.KeySize]byte, ...) (*protocoltypes.PushServiceReceiver, error)
- func InternalEncryptPushPayloadForReceiver(privateKey *[cryptoutil.KeySize]byte, rawPayload, recipientPublicKey []byte) ([]byte, error)
- func PushDispatcherKey(tokenType pushtypes.PushServiceTokenType, bundleID string) string
- func PushServiceGenerateDispatchers(dispatchers []PushDispatcher) (map[string]PushDispatcher, []*pushtypes.PushServiceSupportedTokenType, error)
- type PushDispatcher
- type PushService
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 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)
Click to show internal directories.
Click to hide internal directories.