firehose

package module
v0.0.0-...-44d7ca6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: MIT Imports: 8 Imported by: 0

README

go-firehose

A batch producer for AWS Firehose. Forked from github.com/erikreppel/go-firehose so I could remove the apex logger.

License

MIT

Documentation

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: the name of the Kinesis Firehose.
	FireHoseName string

	// Region is the AWS region of the Kinesis Firehose
	Region string

	// FlushInterval: how often to flush the buffer.
	FlushInterval time.Duration

	// BufferSize: the batch request size (cannot be greater than 500).
	BufferSize int

	// BacklogSize
	BacklogSize int

	// Backoff: strategy to use for failures.
	Backoff backoff.Backoff

	// Client is a firehose API instance
	Client firehoseiface.FirehoseAPI
}

Config ..

type Producer

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

Producer handles batching of records

func New

func New(c Config) *Producer

New producer with given config

func (*Producer) Put

func (p *Producer) Put(data []byte) 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.

Jump to

Keyboard shortcuts

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