kinesis

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

Documentation

Overview

Package kinesis provides structs for working with AWS Kinesis records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(h Handler)

Handle Kinesis events with handler.

func HandleFunc

func HandleFunc(h HandlerFunc)

HandleFunc handles Kinesis events with callback function.

Types

type Event

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

Event represents a Kinesis event with one or more records.

type Handler

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

Handler handles Kinesis events.

type HandlerFunc

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

HandlerFunc unmarshals Kinesis events before passing control.

func (HandlerFunc) Handle

func (h HandlerFunc) Handle(data json.RawMessage, ctx *apex.Context) (interface{}, error)

Handle implements apex.Handler.

func (HandlerFunc) HandleKinesis

func (h HandlerFunc) HandleKinesis(event *Event, ctx *apex.Context) error

type Record

type Record struct {
	EventSource       string `json:"eventSource"`
	EventVersion      string `json:"eventVersion"`
	EventID           string `json:"eventID"`
	EventName         string `json:"eventName"`
	InvokeIdentityARN string `json:"invokeIdentityArn"`
	AWSRegion         string `json:"awsRegion"`
	EventSourceARN    string `json:"eventSourceARN"`
	Kinesis           struct {
		SchemaVersion  string `json:"kinesisSchemaVersion"`
		PartitionKey   string `json:"partitionKey"`
		SequenceNumber string `json:"sequenceNumber"`
		Data           []byte `json:"data"`
	}
}

Record represents a single Kinesis record.

Jump to

Keyboard shortcuts

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