Documentation
¶
Index ¶
- Constants
- Variables
- func IsDeliveryFailure(err error) bool
- func IsEndpointDisabled(err error) bool
- func IsEndpointNotFound(err error) bool
- type API
- type AppCreateAPNSFunc
- type AppCreateAPNSSandboxFunc
- type AppCreateGCMFunc
- type Endpoint
- type EndpointCreateFunc
- type EndpointRetrieveFunc
- type EndpointUpdateFunc
- type Error
- type Platform
- type PushFunc
Constants ¶
const ( AttributeEnabled = "Enabled" AttributeToken = "Token" AttributeEndpointCreated = "EventEndpointCreated" AttributeEndpointDeleted = "EventEndpointDeleted" AttributeEndpointUpdated = "EventEndpointUpdated" AttributeDeliveryFailure = "EventDeliveryFailure" AttributePlatformCredential = "PlatformCredential" AttributePlatformPrincipal = "PlatformPrincipal" )
Message Attributes.
const ( TypeDeliveryFailure = "DeliveryFailure" TypeNotification = "Notification" )
Message Types.
Variables ¶
var ( ErrDeliveryFailure = errors.New("delivery failed") ErrEndpointDisabled = errors.New("endppint disabled") ErrEndpointNotFound = errors.New("endpoint not found") )
Common errors for Device serive implementations and validations.
var PlatformIdentifiers = map[Platform]string{ PlatformAPNS: "APNS", PlatformAPNSSandbox: "APNS_SANDBOX", PlatformGCM: "GCM", }
PlatformIdentifiers helps to map Platfrom to human-readable strings.
Functions ¶
func IsDeliveryFailure ¶
IsDeliveryFailure indicates if err is ErrDeliveryFailure
func IsEndpointDisabled ¶
IsEndpointDisabled indicates if err is ErrEndpointDisabled.
func IsEndpointNotFound ¶
IsEndpointNotFound indicates if err is ErrEndpointNotFound.
Types ¶
type API ¶
type API interface { CreatePlatformApplication(*sns.CreatePlatformApplicationInput) (*sns.CreatePlatformApplicationOutput, error) CreatePlatformEndpoint(*sns.CreatePlatformEndpointInput) (*sns.CreatePlatformEndpointOutput, error) GetEndpointAttributes(*sns.GetEndpointAttributesInput) (*sns.GetEndpointAttributesOutput, error) SetEndpointAttributes(*sns.SetEndpointAttributesInput) (*sns.SetEndpointAttributesOutput, error) Publish(*sns.PublishInput) (*sns.PublishOutput, error) }
API bundles common SNS interactions in a reasonably sized interface.
type AppCreateAPNSFunc ¶
AppCreateAPNSFunc creates a new platform application for APNS production.
func AppCreateAPNS ¶
func AppCreateAPNS(api API, changeTopic string) AppCreateAPNSFunc
AppCreateAPNS creates a new platform application for APNS production.
type AppCreateAPNSSandboxFunc ¶
AppCreateAPNSSandboxFunc creates a new platform application for APNS sandbox.
func AppCreateAPNSSandbox ¶
func AppCreateAPNSSandbox(api API, changeTopic string) AppCreateAPNSSandboxFunc
AppCreateAPNSSandbox creates a new platform application for APNS sandbox.
type AppCreateGCMFunc ¶
AppCreateGCMFunc creates a new platform application for GCM.
func AppCreateGCM ¶
func AppCreateGCM(api API, changeTopic string) AppCreateGCMFunc
AppCreateGCM creates a new platform application for GCM.
type EndpointCreateFunc ¶
EndpointCreateFunc registers a new device endpoint for the given platform and token.
func EndpointCreate ¶
func EndpointCreate(api API) EndpointCreateFunc
EndpointCreate registers a new device endpoint for the given platform and token.
type EndpointRetrieveFunc ¶
EndpointRetrieveFunc returns the Endpoint for the given ARN.
func EndpointRetrieve ¶
func EndpointRetrieve(api API) EndpointRetrieveFunc
EndpointRetrieve returns the Endpoint for the given ARN.
type EndpointUpdateFunc ¶
EndpointUpdateFunc takes a new token and stores it with the Endpoint.
func EndpointUpdate ¶
func EndpointUpdate(api API) EndpointUpdateFunc
EndpointUpdate takes a new token and stores it with the Endpoint.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps common Device errors.