awssns

package
v0.0.0-...-8291241 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Types

type ConfirmSubscriptionResponse

type ConfirmSubscriptionResponse struct {
	XMLName         xml.Name `xml:"ConfirmSubscriptionResponse"`
	SubscriptionArn string   `xml:"ConfirmSubscriptionResult>SubscriptionArn"`
	RequestId       string   `xml:"ResponseMetadata>RequestId"`
}

ConfirmSubscriptionResponse contains the XML response of accessing a SubscribeURL

type Payload

type Payload struct {
	Message          string `json:"Message"`
	MessageId        string `json:"MessageId"`
	Signature        string `json:"Signature"`
	SignatureVersion string `json:"SignatureVersion"`
	SigningCertURL   string `json:"SigningCertURL"`
	SubscribeURL     string `json:"SubscribeURL"`
	Subject          string `json:"Subject"`
	Timestamp        string `json:"Timestamp"`
	Token            string `json:"Token"`
	TopicArn         string `json:"TopicArn"`
	Type             string `json:"Type"`
	UnsubscribeURL   string `json:"UnsubscribeURL"`
}

Payload contains a single POST from SNS

func (*Payload) BuildSignedContent

func (payload *Payload) BuildSignedContent() ([]byte, error)

BuildSignature returns a byte array containing a signature usable for SNS verification

func (*Payload) Subscribe

func (payload *Payload) Subscribe() (ConfirmSubscriptionResponse, error)

Subscribe will use the SubscribeURL in a payload to confirm a subscription and return a ConfirmSubscriptionResponse

func (*Payload) Unsubscribe

func (payload *Payload) Unsubscribe() (UnsubscribeResponse, error)

Unsubscribe will use the UnsubscribeURL in a payload to confirm a subscription and return a UnsubscribeResponse

func (*Payload) VerifyPayload

func (payload *Payload) VerifyPayload() error

VerifyPayload will verify that a payload came from SNS

type UnsubscribeResponse

type UnsubscribeResponse struct {
	XMLName   xml.Name `xml:"UnsubscribeResponse"`
	RequestId string   `xml:"ResponseMetadata>RequestId"`
}

UnsubscribeResponse contains the XML response of accessing an UnsubscribeURL

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL