Documentation ¶
Overview ¶
Package sns provides structs for working with AWS SNS records.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleFunc ¶
func HandleFunc(h HandlerFunc)
HandleFunc handles SNS events with callback function.
Types ¶
type Event ¶
type Event struct {
Records []*Record `json:"Records"`
}
Event represents a SNS event. It is safe to assume a single record will be present, as AWS will not send more than one.
type HandlerFunc ¶
HandlerFunc unmarshals SNS events before passing control.
func (HandlerFunc) Handle ¶
func (h HandlerFunc) Handle(data json.RawMessage, ctx *apex.Context) (interface{}, error)
Handle implements apex.Handler.
type Record ¶
type Record struct { EventSource string `json:"EventSource"` EventVersion string `json:"EventVersion"` SNS struct { Type string `json:"Type"` MessageID string `json:"MessageID"` TopicARN string `json:"TopicArn"` Subject string `json:"Subject"` Message string `json:"Message"` Timestamp time.Time `json:"Timestamp"` SignatureVersion string `json:"SignatureVersion"` Signature string `json:"Signature"` SignatureCertURL string `json:"SignatureCertURL"` UnsubscribeURL string `json:"UnsubscribeURL"` MessageAttributes map[string]interface{} `json:"MessageAttributes"` } `json:"Sns"` }
Record represents a single SNS record.
Click to show internal directories.
Click to hide internal directories.