producer

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher interface {
	// Put is a blocking operation that will attempt to write the data at most once to kinesis.
	// Any unrecoverable errors such as misconfigured client or hard limits being exceeded
	// will result in consumeerr.Permanent being returned to allow for existing retry patterns within
	// the project to be used.
	Put(ctx context.Context, b *batch.Batch) error

	// Ready ensures that the configuration is valid and can write the configured stream.
	Ready(ctx context.Context) error
}

Batcher abstracts the raw kinesis client to reduce complexity with delivering dynamic encoded data.

func NewBatcher

func NewBatcher(kinesisAPI Kinesis, stream string, opts ...BatcherOptions) (Batcher, error)

type BatcherOptions

type BatcherOptions func(*batcher) error

func WithLogger

func WithLogger(l *zap.Logger) BatcherOptions

WithLogger sets the provided logger for the Batcher

type Kinesis added in v0.60.0

type Kinesis interface {
	DescribeStream(ctx context.Context, params *kinesis.DescribeStreamInput, optFns ...func(*kinesis.Options)) (*kinesis.DescribeStreamOutput, error)
	PutRecords(ctx context.Context, params *kinesis.PutRecordsInput, optFns ...func(*kinesis.Options)) (*kinesis.PutRecordsOutput, error)
}

Kinesis is the interface used to interact with the V2 API for the aws SDK since the *iface packages have been deprecated

Jump to

Keyboard shortcuts

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