s3

package
v0.0.0-...-408b988 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

README

Replay events from S3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(c *config)

Option allows the behavior of the replay.ReadCloser to be specified

func WithFilter

func WithFilter(filter func(filename string) bool) Option

WithFilter allows an optional filename filter to be specified; by default,

func WithS3

func WithS3(api *s3.S3) Option

WithS3 allows an instance of an S3 client to be provided; by default New should construct a default s3 client from environment variables

type Replayer

type Replayer struct {
	// contains filtered or unexported fields
}

Replayer replays events from an S3 stream; you may assume events are encoded 1 per line as a base64 encoded string.

* files with a .gz extension should be ungzipped * files with a .zip extension should be unziped

func New

func New(s3uri string, opts ...Option) *Replayer

New constructs a new s3.Replayer which should implement replay.ReadCloser Should construct a default s3 client from environment variables.

s3uri will be of the form s3://bucket/path

func (*Replayer) Close

func (r *Replayer) Close() error

Close releases any resources associated with the stream replayer

func (*Replayer) ReadEvent

func (r *Replayer) ReadEvent() ([]byte, error)

ReadEvent reads a single event from the s3 stream

Jump to

Keyboard shortcuts

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