kinesis

package
v0.0.0-...-aec1f2c Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(stream string, items interface{}) ([]kinesis.PutRecordsResultEntry, error)

Emit a slice of data to a kinesis stream This will convert the data into record entries and emit properly By default, the partition key is not set If an item implements Partitioner, partition key will be retrieved accordingly

func Handler

func Handler(fn HandlerFunc) scaffold.HandlerFunc

Types

type Event

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

func EventFromItems

func EventFromItems(items interface{}) *Event

type EventRecord

type EventRecord struct {
	EventSourceARN    string           `json:"eventSourceARN"`
	EventSource       string           `json:"eventSource"`
	AwsRegion         string           `json:"awsRegion"`
	EventID           string           `json:"eventID"`
	EventVersion      string           `json:"eventVersion"`
	Kinesis           *EventRecordData `json:"kinesis"`
	InvokeIdentityArn string           `json:"invokeIdentityARN"`
	EventName         string           `json:"eventName"`
}

type EventRecordData

type EventRecordData struct {
	ApproximateArrivalTimestamp float64 `json:"approximateArrivalTimestamp"`
	PartitionKey                *string `json:"partitionKey"`
	Data                        string  `json:"data"`
	KinesisSchemaVersion        string  `json:"kinesisSchemaVersion"`
	SequenceNumber              string  `json:"sequenceNumber"`
}

func (*EventRecordData) JsonMarshal

func (rk *EventRecordData) JsonMarshal(v interface{})

func (EventRecordData) JsonUnmarshal

func (rk EventRecordData) JsonUnmarshal(v interface{}) error

type HandlerFunc

type HandlerFunc func(ctx context.Context, evt *Event) (interface{}, error)

type Partitioner

type Partitioner interface {
	PartitionKey() string
}

Jump to

Keyboard shortcuts

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