package
0.0.0-20200409172854-0805cb333282
Repository: https://github.com/uniqush/uniqush-push.git
Documentation: pkg.go.dev

# Functions

GetPushServiceManager will return the singleton push service manager, instantiating it if this is the first time this method is called.
IsSamePSP returns whether or not the name, FixedData, and VolatileData of two PSPs are identical.
NewBadDeliveryPointWithDetails creates a BadDeliveryPoint error with the delivery point, along with an error message.
NewBadNotificationWithDetails returns a BadNotification with an error message.
NewBadPushServiceProviderWithDetails returns a BadPushServiceProvider error with details about why it is invalid.
NewConnectionError returns a new ConnectionError.
NewDeliveryPointUpdate returns a DeliveryPointUpdate indicating error handler should updating the passed in delivery point.
NewEmptyDeliveryPoint initializes the data structures of this delivery point, which will be populated by the caller.
NewEmptyNotification returns an initialized notification with no data.
NewEmptyPushServiceProvider initializes the data structures of this push service provider, which will be populated by the caller.
NewError returns an ErrorReport for the given error message to be reported to the user (with a severity of 'error').
NewErrorf returns an ErrorReport for the given format string and arguments to be reported to the user (with a severity of 'error').
NewIncompatibleError creates an IncompatibleError.
NewInfo returns an InfoReport for the given message to be reported to the user (with a severity of 'info').
NewInfof returns an InfoReport for the given format string and arguments to be reported to the user (with a severity of 'info').
NewInvalidRegistrationUpdate returns an InvalidRegistrationUpdate for this delivery point and push service provider.
NewPushServiceConfig returns an accessor for the given section name of the unserialized config file (for the push service with that name, e.g.
NewPushServiceProviderUpdate creates an error indicating that the psp's volatile data should be updated.
NewRetryError builds a RetryError with no associated reason.
NewRetryErrorWithReason builds a RetryError with the associated error causing uniqush-push to retry the push after the given duration.
NewUnsubscribeUpdate returns an UnsubscribeUpdate for the given psp and dp.
UnserializeSubscription unserializes the data (of the form "<pushservicetype>:{...}") about a user's subscription, to be returned to uniqush's clients.

# Constants

AppVersion is optional.
Fields which may or may not be in VolatileData of any DeliveryPoint DeviceID is used by **clients of** uniqush to uniquely identify the device which a given DeliveryPoint corresponds to.
Fields in FixedData, found in each DeliveryPoint.
Hack specific to our company.
Fields in FixedData, found in each DeliveryPoint.
SubscribeDate is optional, can be used by clients for seeing the most recent date when a DP was added.
Fields in FixedData, found in each DeliveryPoint.

# Structs

BadDeliveryPoint indicates that the delivery point has missing or invalid data, and as a result, it can't be pushed to.
BadNotification indicates that the notification body for a given push service provider or delivery point has been rejected, either by uniqush-push or by the external push service.
BadPushServiceProvider indicates that uniqush-push or the external push service has rejected our push service provider's credentials.
ConnectionError indicates that we failed to establish a network connection (or send the request) to the external push service.
DeliveryPoint contains information about a user+app+device.
DeliveryPointUpdate indicates that a delivery point has been updated after a push attempt (e.g.
ErrorReport is like InfoReport, but has a higher severity.
IncompatibleError indicates that the delivery point was incompatible with the push service, etc.
InfoReport is not an actual error.
InvalidRegistrationUpdate indicates that the external push service provider's response told uniqush that the delivery point was invalid/no longer valid, so the error handler should remove this delivery point from the database.
Notification is an abstraction of the push notification request from a client of uniqush-push.
PushPeer implements common functionality for pushes.
PushServiceConfig accesses the section for 'name' of the given ConfigFile.
PushServiceManager is a singleton which stores all of the push service implementations.
PushServiceProvider contains the data needed to send pushes to an external push notifications service provider (certificates, pushservicetype, server address, etc.).
PushServiceProviderUpdate is an error object indicating that the push service provider's VolatileData was updated.
Result is an abstraction of the result of a request to push to an external service.
RetryError indicates to the user that the push attempt for the given delivery point should be re-attempted after the given duration (uniqush retries failed pushes for some push services with exponential backoff and a finite number of re-attempts).
UnsubscribeUpdate indicates that the external push service told us that the given delivery point's was unsubscribed (and the error handler should remove that delivery point from the db).

# Interfaces

Error is a specialized error.
PushServiceType instances contain abstractions for working with a single push service type (ADM, APNS, GCM, FCM).