Versions in this module Expand all Collapse all v1 v1.0.2 Oct 6, 2022 v1.0.1 Oct 6, 2022 Changes in this version + const HostDevelopment + const HostProduction + const PriorityHigh + const PriorityLow + const ReasonBadCertificate + const ReasonBadCertificateEnvironment + const ReasonBadCollapseID + const ReasonBadDeviceToken + const ReasonBadExpirationDate + const ReasonBadMessageID + const ReasonBadPath + const ReasonBadPriority + const ReasonBadTopic + const ReasonDeviceTokenNotForTopic + const ReasonDuplicateHeaders + const ReasonExpiredProviderToken + const ReasonForbidden + const ReasonIdleTimeout + const ReasonInternalServerError + const ReasonInvalidProviderToken + const ReasonInvalidPushType + const ReasonMethodNotAllowed + const ReasonMissingDeviceToken + const ReasonMissingProviderToken + const ReasonMissingTopic + const ReasonPayloadEmpty + const ReasonPayloadTooLarge + const ReasonServiceUnavailable + const ReasonShutdown + const ReasonTooManyProviderTokenUpdates + const ReasonTooManyRequests + const ReasonTopicDisallowed + const ReasonUnregistered + const StatusSent + var DefaultHost = HostDevelopment + var DialTLS = func(network, addr string, cfg *tls.Config) (net.Conn, error) + var HTTPClientTimeout = 60 * time.Second + var ReadIdleTimeout = 15 * time.Second + var TCPKeepAlive = 15 * time.Second + var TLSDialTimeout = 20 * time.Second + type Client struct + Certificate tls.Certificate + HTTPClient *http.Client + Host string + Token *token.Token + func NewClient(certificate tls.Certificate) *Client + func NewTokenClient(token *token.Token) *Client + func (c *Client) CloseIdleConnections() + func (c *Client) Development() *Client + func (c *Client) Production() *Client + func (c *Client) Push(n *Notification) (*Response, error) + func (c *Client) PushWithContext(ctx Context, n *Notification) (*Response, error) + type ClientManager struct + Factory func(certificate tls.Certificate) *Client + MaxAge time.Duration + MaxSize int + func NewClientManager() *ClientManager + func (m *ClientManager) Add(client *Client) + func (m *ClientManager) Get(certificate tls.Certificate) *Client + func (m *ClientManager) Len() int + type Context interface + type EPushType string + const PushTypeAlert + const PushTypeBackground + const PushTypeComplication + const PushTypeFileProvider + const PushTypeLocation + const PushTypeMDM + const PushTypeVOIP + type Notification struct + ApnsID string + CollapseID string + DeviceToken string + Expiration time.Time + Payload interface{} + Priority int + PushType EPushType + Topic string + func (n *Notification) MarshalJSON() ([]byte, error) + type Response struct + ApnsID string + Reason string + StatusCode int + Timestamp Time + func (c *Response) Sent() bool + type Time struct + func (t *Time) UnmarshalJSON(b []byte) error