kinesis

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertEventsRecords

func ConvertEventsRecords(records []events.KinesisEventRecord) []*kinesis.Record

ConvertEventsRecords converts Kinesis records between the Lambda and Go SDK packages. This is required for deaggregating Kinesis records processed by AWS Lambda.

func New

func New(cfg iaws.Config) *kinesis.Kinesis

New returns a configured Kinesis client.

Types

type API

type API struct {
	Client kinesisiface.KinesisAPI
}

API wraps the Kinesis API interface.

func (*API) ActiveShards

func (a *API) ActiveShards(ctx aws.Context, stream string) (int64, error)

ActiveShards returns the number of in-use shards for a Kinesis stream.

func (*API) GetRecords

func (a *API) GetRecords(ctx aws.Context, iterator string) (*kinesis.GetRecordsOutput, error)

GetRecords wraps the GetRecordsWithContext API.

func (*API) GetShardIterator

func (a *API) GetShardIterator(ctx aws.Context, stream, shard, iteratorType string) (*kinesis.GetShardIteratorOutput, error)

GetShardIterator wraps the GetShardIteratorWithContext API.

func (*API) GetTags

func (a *API) GetTags(ctx aws.Context, stream string) ([]*kinesis.Tag, error)

GetTags recursively retrieves all tags for a Kinesis stream.

func (*API) IsEnabled

func (a *API) IsEnabled() bool

IsEnabled returns true if the client is enabled and ready for use.

func (*API) ListShards

func (a *API) ListShards(ctx aws.Context, stream string) (*kinesis.ListShardsOutput, error)

ListShards wraps the ListShardsWithContext API.

func (*API) PutRecords

func (a *API) PutRecords(ctx aws.Context, stream, partitionKey string, data [][]byte) (*kinesis.PutRecordsOutput, error)

PutRecords is a convenience wrapper for putting multiple records into a Kinesis stream.

func (*API) Setup

func (a *API) Setup(cfg iaws.Config)

Setup creates a new Kinesis client.

func (*API) UpdateShards

func (a *API) UpdateShards(ctx aws.Context, stream string, shards int64) error

UpdateShards uniformly updates a Kinesis stream's shard count and returns when the update is complete.

func (*API) UpdateTag

func (a *API) UpdateTag(ctx aws.Context, stream, key, value string) error

UpdateTag updates a tag on a Kinesis stream.

type Aggregate

type Aggregate struct {
	Record       *rec.AggregatedRecord
	Count        int
	Size         int
	PartitionKey string
}

Aggregate produces a KPL-compliant Kinesis record

func (*Aggregate) Add

func (a *Aggregate) Add(data []byte, partitionKey string) bool

Add inserts a Kinesis record into an aggregated Kinesis record https://github.com/awslabs/kinesis-aggregation/blob/398fbd4b430d4bf590431b301d03cbbc94279cef/python/aws_kinesis_agg/aggregator.py#L382

Jump to

Keyboard shortcuts

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