1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
package sns
import (
"time"
)
const (
MESSAGE_TYPE_SUBSCRIPTION_CONFIRMATION = "SubscriptionConfirmation"
MESSAGE_TYPE_UNSUBSCRIBE_CONFIRMATION = "UnsubscribeConfirmation"
MESSAGE_TYPE_NOTIFICATION = "Notification"
)
// Json http notifications
// SNS posts those to your http url endpoint if http is selected as delivery method.
// http://docs.aws.amazon.com/sns/latest/dg/json-formats.html#http-subscription-confirmation-json
// http://docs.aws.amazon.com/sns/latest/dg/json-formats.html#http-notification-json
// http://docs.aws.amazon.com/sns/latest/dg/json-formats.html#http-unsubscribe-confirmation-json
type HttpNotification struct {
Type string `json:"Type"`
MessageId string `json:"MessageId"`
Token string `json:"Token" optional` // Only for subscribe and unsubscribe
TopicArn string `json:"TopicArn"`
Subject string `json:"Subject" optional` // Only for Notification
Message string `json:"Message"`
SubscribeURL string `json:"SubscribeURL" optional` // Only for subscribe and unsubscribe
Timestamp time.Time `json:"Timestamp"`
SignatureVersion string `json:"SignatureVersion"`
Signature string `json:"Signature"`
SigningCertURL string `json:"SigningCertURL"`
UnsubscribeURL string `json:"UnsubscribeURL" optional` // Only for notifications
}
|