cognito

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: 2 Imported by: 0

Documentation

Overview

Package cognito provides structs for working with AWS Cognito records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(h Handler)

Handle Cognito events with handler.

func HandleFunc

func HandleFunc(h HandlerFunc)

HandleFunc handles Cognito events with callback function.

Types

type Change

type Change struct {
	Old string `json:"oldValue"`
	New string `json:"newValue"`
	Op  string `json:"op"`
}

Change represents a single Cognito data record change.

type Event

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

Event represents a Cognito event with one or more records.

type Handler

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

Handler handles Cognito events.

type HandlerFunc

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

HandlerFunc unmarshals Cognito 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 {
	Version        int                `json:"version"`
	EventType      string             `json:"eventType"`
	Region         string             `json:"region"`
	IdentityPoolID string             `json:"identityPoolId"`
	IdentityID     string             `json:"identityId"`
	DatasetName    string             `json:"datasetName"`
	DatasetRecords map[string]*Change `json:"datasetRecords"`
}

Record represents a single Cognito record.

Jump to

Keyboard shortcuts

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