dynamo

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: 9

Documentation

Overview

Package dynamo provides structs for working with AWS Dynamo records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(h Handler)

Handle Dynamo events with handler.

func HandleFunc

func HandleFunc(h HandlerFunc)

HandleFunc handles Dynamo events with callback function.

Types

type Event

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

Event represents a Dynamo event with one or more records.

type Handler

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

Handler handles Dynamo events.

type HandlerFunc

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

HandlerFunc unmarshals Dynamo 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 {
	EventID        string        `json:"eventID"`
	EventName      string        `json:"eventName"`
	EventSource    string        `json:"eventSource"`
	EventSourceARN string        `json:"eventSourceARN"`
	EventVersion   string        `json:"eventVersion"`
	AWSRegion      string        `json:"awsRegion"`
	Dynamodb       *StreamRecord `json:"dynamodb"`
}

Record represents a single Dynamo record.

type StreamRecord

type StreamRecord struct {
	ApproximateCreationDateTime int64
	Keys                        map[string]*dynamodb.AttributeValue
	NewImage                    map[string]*dynamodb.AttributeValue
	OldImage                    map[string]*dynamodb.AttributeValue
	SequenceNumber              string
	SizeBytes                   int64
	StreamViewType              string
}

StreamRecord represents a Dynamo stream records

Jump to

Keyboard shortcuts

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