ses

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ses provides structs for working with AWS SES records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(h Handler)

Handle SES events with handler.

func HandleFunc

func HandleFunc(h HandlerFunc)

HandleFunc handles SES events with callback function.

Types

type Event

type Event struct {
	Records []*Record `json:"Records"`
}

Event represents a SES event with one or more records.

type Handler

type Handler interface {
	HandleSES(*Event, *apex.Context) error
}

Handler handles SES events.

type HandlerFunc

type HandlerFunc func(*Event, *apex.Context) error

HandlerFunc unmarshals SES 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"`
	SES          struct {
		Receipt struct {
			Type              string                 `json:"Type"`
			MessageID         string                 `json:"MessageID"`
			TopicARN          string                 `json:"TopicArn"`
			Subject           string                 `json:"Subject"`
			Message           []byte                 `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:"receipt"`
		Mail struct {
			Type              string                 `json:"Type"`
			MessageID         string                 `json:"MessageID"`
			TopicARN          string                 `json:"TopicArn"`
			Subject           string                 `json:"Subject"`
			Message           []byte                 `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:"mail"`
	} `json:"ses"`
}

Record represents a single SES record.

Jump to

Keyboard shortcuts

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