kinesis

package module
v0.0.0-...-08b17f5 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2017 License: MIT Imports: 8 Imported by: 32

README

GoDoc

go-kinesis

Batch producer for Kinesis built on top of the official Go AWS SDK.

License

MIT

Documentation

Overview

Package kinesis implements a batch producer built on top of the official AWS SDK.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordSizeExceeded = errors.New("kinesis: record size exceeded")
)

Errors.

Functions

This section is empty.

Types

type Config

type Config struct {
	// StreamName is the Kinesis stream.
	StreamName string

	// FlushInterval is a regular interval for flushing the buffer. Defaults to 1s.
	FlushInterval time.Duration

	// BufferSize determines the batch request size. Must not exceed 500. Defaults to 500.
	BufferSize int

	// BacklogSize determines the channel capacity before Put() will begin blocking. Defaults to 500.
	BacklogSize int

	// Backoff determines the backoff strategy for record failures.
	Backoff backoff.Backoff

	// Logger is the logger used. Defaults to log.Log.
	Logger log.Interface

	// Client is the Kinesis API implementation.
	Client kinesisiface.KinesisAPI
}

type Producer

type Producer struct {
	Config
	// contains filtered or unexported fields
}

Producer batches records.

func New

func New(config Config) *Producer

New producer with the given config.

func (*Producer) Put

func (p *Producer) Put(data []byte, partitionKey string) error

Put record `data` using `partitionKey`. This method is thread-safe.

func (*Producer) Start

func (p *Producer) Start()

Start the producer.

func (*Producer) Stop

func (p *Producer) Stop()

Stop the producer. Flushes any in-flight data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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