Documentation ¶
Index ¶
- Constants
- func String(v string) *string
- type AmazonSNS
- func (svc *AmazonSNS) BulkPublish(tokens map[string][]string, msg string) error
- func (svc *AmazonSNS) BulkPublishByDevice(device string, tokens []string, msg string) error
- func (svc *AmazonSNS) CreateTopic(name string) (*SNSTopic, error)
- func (svc *AmazonSNS) GetApp(typ string) (*SNSApp, error)
- func (svc *AmazonSNS) GetAppAPNS() (*SNSApp, error)
- func (svc *AmazonSNS) GetAppGCM() (*SNSApp, error)
- func (svc *AmazonSNS) GetEndpoint(arn string) (*SNSEndpoint, error)
- func (svc *AmazonSNS) NewApp(arn, pf string) *SNSApp
- func (svc *AmazonSNS) NewApplicationEndpoint(arn string) *SNSEndpoint
- func (svc *AmazonSNS) NewEndpoint(arn, protocol string) *SNSEndpoint
- func (svc *AmazonSNS) NewTopic(arn, name string) *SNSTopic
- func (svc *AmazonSNS) Publish(arn string, msg string, opt map[string]interface{}) error
- func (svc *AmazonSNS) PublishAPNSByToken(token string, msg string, badge int) error
- func (svc *AmazonSNS) PublishByToken(device, token string, msg string, badge int) error
- func (svc *AmazonSNS) PublishGCMByToken(token string, msg string, badge int) error
- func (svc *AmazonSNS) RegisterEndpoint(device, token string) (*SNSEndpoint, error)
- type SNSApp
- type SNSEndpoint
- func (e *SNSEndpoint) Enable() bool
- func (e *SNSEndpoint) GetARN() string
- func (e *SNSEndpoint) GetToken() string
- func (e *SNSEndpoint) Publish(msg string, badge int) error
- func (e *SNSEndpoint) SetToken(token string)
- func (e *SNSEndpoint) UpdateToken() error
- func (e *SNSEndpoint) UpdateTokenAsDisable() error
- func (e *SNSEndpoint) UpdateTokenAsEnable() error
- type SNSTopic
Constants ¶
const ( AppTypeAPNS = "apns" AppTypeAPNSSandbox = "apns_sandbox" AppTypeGCM = "gcm" MessageBodyLimit = 2000 ProtocolApplication = "application" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AmazonSNS ¶
func (*AmazonSNS) BulkPublish ¶
Publish notification for many endpoints tokens is map of string slices, each key stands for device, like "android"/"ios" ex) tokens := map[string][]string{ "android": []string{"token1", "token2"}, "ios": []string{"token3", "token4"}}
func (*AmazonSNS) BulkPublishByDevice ¶
Publish notification for many endpoints (supports single device only)
func (*AmazonSNS) CreateTopic ¶
Create SNS Topic and return `TopicARN`
func (*AmazonSNS) GetAppAPNS ¶
Get SNSApp struct of Apple Push Notification Service for iOS
func (*AmazonSNS) GetEndpoint ¶
func (svc *AmazonSNS) GetEndpoint(arn string) (*SNSEndpoint, error)
GetEndpoint
func (*AmazonSNS) NewApplicationEndpoint ¶
func (svc *AmazonSNS) NewApplicationEndpoint(arn string) *SNSEndpoint
func (*AmazonSNS) NewEndpoint ¶
func (svc *AmazonSNS) NewEndpoint(arn, protocol string) *SNSEndpoint
func (*AmazonSNS) PublishAPNSByToken ¶
PublishAPNSByToken sends push message for iOS device by device token
func (*AmazonSNS) PublishByToken ¶
PublishByToken sends push message by device token
func (*AmazonSNS) PublishGCMByToken ¶
PublishGCMByToken sends push message for Android device by device token
func (*AmazonSNS) RegisterEndpoint ¶
func (svc *AmazonSNS) RegisterEndpoint(device, token string) (*SNSEndpoint, error)
Register endpoint(device) to application
type SNSApp ¶
type SNSApp struct {
// contains filtered or unexported fields
}
func (*SNSApp) CreateEndpoint ¶
func (a *SNSApp) CreateEndpoint(token string) (*SNSEndpoint, error)
Create Endpoint(add device) and return `EndpointARN`
type SNSEndpoint ¶
type SNSEndpoint struct {
// contains filtered or unexported fields
}
SNSEndpoint is struct for endpoint(device / )
func (*SNSEndpoint) GetToken ¶
func (e *SNSEndpoint) GetToken() string
GetToken returns endpoint Token
func (*SNSEndpoint) Publish ¶
func (e *SNSEndpoint) Publish(msg string, badge int) error
Publish sends push notification to the endpoint
func (*SNSEndpoint) SetToken ¶
func (e *SNSEndpoint) SetToken(token string)
SetToken set endpoint Token
func (*SNSEndpoint) UpdateToken ¶
func (e *SNSEndpoint) UpdateToken() error
UpdateToken updates endpoint attributes
func (*SNSEndpoint) UpdateTokenAsDisable ¶
func (e *SNSEndpoint) UpdateTokenAsDisable() error
UpdateTokenAsEnable updates token and enabled as false
func (*SNSEndpoint) UpdateTokenAsEnable ¶
func (e *SNSEndpoint) UpdateTokenAsEnable() error
UpdateTokenAsEnable updates token and enabled as true