kinesis

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetCondition

type GetCondition struct {
	ShardID           string
	ShardIterator     string
	ShardIteratorType IteratorType
	Limit             int64
}

GetCondition has option values for `GetRecord` operation.

type IteratorType

type IteratorType string

IteratorType is ShardIteratorType.

const (
	IteratorTypeLatest      IteratorType = "LATEST"
	IteratorTypeTrimHorizon IteratorType = "TRIM_HORIZON"
)

ShardIteratorType

func (IteratorType) String

func (it IteratorType) String() string

String returns the IteratorType as string type. If it's empty string, then returns `LATEST`.

type Kinesis

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

Kinesis has Kinesis client.

func New

func New(conf config.Config) (*Kinesis, error)

New returns initialized *Kinesis.

func (*Kinesis) CreateStream

func (svc *Kinesis) CreateStream(in *SDK.CreateStreamInput) error

CreateStream creates new Kinesis Stream.

func (*Kinesis) CreateStreamWithName

func (svc *Kinesis) CreateStreamWithName(name string) error

CreateStreamWithName creates new Kinesis Stream by given name with prefix.

func (*Kinesis) Errorf

func (svc *Kinesis) Errorf(format string, v ...interface{})

Errorf logging error information.

func (*Kinesis) ForceDeleteStream

func (svc *Kinesis) ForceDeleteStream(name string) error

ForceDeleteStream deletes Kinesis stream by given name with prefix.

func (*Kinesis) GetStream

func (svc *Kinesis) GetStream(name string) (*Stream, error)

GetStream gets Kinesis Stream.

func (*Kinesis) Infof

func (svc *Kinesis) Infof(format string, v ...interface{})

Infof logging information.

func (*Kinesis) IsExistStream

func (svc *Kinesis) IsExistStream(name string) (bool, error)

IsExistStream checks if the Stream already exists or not.

func (*Kinesis) SetLogger

func (svc *Kinesis) SetLogger(logger log.Logger)

SetLogger sets logger.

type RecordResult

type RecordResult struct {
	ShardID           string
	Items             []*SDK.Record
	Count             int
	NextShardIterator string
	Behind            int64
}

RecordResult is struct for result of `GetRecord` operation.

type Stream

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

Stream is Kinesis Stream wrapper struct.

func NewStream

func NewStream(svc *Kinesis, name string) (*Stream, error)

NewStream returns initialized *Stream.

func (*Stream) GetLatestRecords

func (s *Stream) GetLatestRecords() ([]RecordResult, error)

GetLatestRecords gets records from all of the shards.

func (*Stream) GetRecords

func (s *Stream) GetRecords(cond GetCondition) (RecordResult, error)

GetRecords gets record fron given condition.

func (*Stream) GetShardIDs

func (s *Stream) GetShardIDs() (shardIDs []string, err error)

GetShardIDs returns shard id list of the stream.

func (*Stream) PutRecord

func (s *Stream) PutRecord(data []byte) error

PutRecord puts the given data into stream record.

Jump to

Keyboard shortcuts

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