Documentation ¶
Overview ¶
Pacakge nanopush implements an Apple APNs HTTP/2 service for MDM. It implements the PushProvider and PushProviderFactory interfaces.
Index ¶
Constants ¶
const ( Development = "https://api.development.push.apple.com" Development2197 = "https://api.development.push.apple.com:2197" Production = "https://api.push.apple.com" Production2197 = "https://api.push.apple.com:2197" )
Variables ¶
This section is empty.
Functions ¶
func ClientWithCert ¶
ClientWithCert configures an mTLS client cert on the HTTP client.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory instantiates new PushProviders.
func (*Factory) NewPushProvider ¶
func (f *Factory) NewPushProvider(cert *tls.Certificate) (push.PushProvider, error)
NewPushProvider generates a new PushProvider given a tls keypair.
type JSONPushError ¶
JSONPushError is a JSON error returned from the APNs service.
func (*JSONPushError) Error ¶
func (e *JSONPushError) Error() string
type NewClient ¶
type NewClient func(*tls.Certificate) (*http.Client, error)
NewClient describes a callback for setting up an HTTP client for Push notifications.
type Option ¶
type Option func(*Factory)
func WithExpiration ¶
WithExpiration sets the APNs expiration time for the push notifications.
func WithNewClient ¶
WithNewClient sets a callback to setup an HTTP client for each new Push provider.
func WithWorkers ¶
WithWorkers sets how many worker goroutines to use when sending pushes.