kinesis

package
v0.0.0-...-2731d20 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: LGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// Start reading exactly from the position denoted by a specific sequence number.
	ShardIteratorAtSequenceNumber ShardIteratorType = "AT_SEQUENCE_NUMBER"

	// Start reading right after the position denoted by a specific sequence number.
	ShardIteratorAfterSequenceNumber ShardIteratorType = "AFTER_SEQUENCE_NUMBER"

	// Start reading at the last untrimmed record in the shard in the system,
	// which is the oldest data record in the shard.
	ShardIteratorTrimHorizon ShardIteratorType = "TRIM_HORIZON"

	// Start reading just after the most recent record in the shard,
	// so that you always read the most recent data in the shard.
	ShardIteratorLatest ShardIteratorType = "LATEST"

	// The stream is being created. Upon receiving a CreateStream request,
	// Amazon Kinesis immediately returns and sets StreamStatus to CREATING.
	StreamStatusCreating StreamStatus = "CREATING"

	// The stream is being deleted. After a DeleteStream request,
	// the specified stream is in the DELETING state until Amazon Kinesis completes the deletion.
	StreamStatusDeleting StreamStatus = "DELETING"

	// The stream exists and is ready for read and write operations or deletion.
	// You should perform read and write operations only on an ACTIVE stream.
	StreamStatusActive StreamStatus = "ACTIVE"

	// Shards in the stream are being merged or split.
	// Read and write operations continue to work while the stream is in the UPDATING state.
	StreamStatusUpdating StreamStatus = "UPDATING"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DescribeStreamResponse

type DescribeStreamResponse struct {
	StreamDescription StreamDescription
}

Represents the output of a DescribeStream operation.

type Error

type Error struct {
	StatusCode int // HTTP status code (200, 403, ...)
	Status     string
	Code       string `json:"__type"`
	Message    string `json:"message"`
}

Error represents an error in an operation with Kinesis(following goamz/Dynamodb)

func (Error) Error

func (e Error) Error() string

type GetRecordsResponse

type GetRecordsResponse struct {
	NextShardIterator string
	Records           []Record
}

Represents the output of a GetRecords operation.

type GetShardIteratorResponse

type GetShardIteratorResponse struct {
	ShardIterator string
}

Represents the output of a GetShardIterator operation.

type HashKeyRange

type HashKeyRange struct {
	EndingHashKey   string
	StartingHashKey string
}

The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.

func (HashKeyRange) String

func (h HashKeyRange) String() string

type Kinesis

type Kinesis struct {
	aws.Auth
	aws.Region
}

Main Kinesis object

func New

func New(auth aws.Auth, region aws.Region) *Kinesis

New creates a new Kinesis object.

func (*Kinesis) CreateStream

func (k *Kinesis) CreateStream(name string, shardCount int) error

This operation adds a new Amazon Kinesis stream to your AWS account.

func (*Kinesis) DeleteStream

func (k *Kinesis) DeleteStream(name string) error

This operation deletes a stream and all of its shards and data.

func (*Kinesis) DescribeStream

func (k *Kinesis) DescribeStream(name string) (resp *StreamDescription, err error)

This operation returns the following information about the stream: the current status of the stream, the stream Amazon Resource Name (ARN), and an array of shard objects that comprise the stream.

func (*Kinesis) GetRecords

func (k *Kinesis) GetRecords(shardIterator string, limit int) (resp *GetRecordsResponse, err error)

This operation returns one or more data records from a shard.

func (*Kinesis) GetShardIterator

func (k *Kinesis) GetShardIterator(shardId, streamName string, iteratorType ShardIteratorType, sequenceNumber string) (resp *GetShardIteratorResponse, err error)

This operation returns a shard iterator in ShardIterator. The shard iterator specifies the position in the shard from which you want to start reading data records sequentially.

func (*Kinesis) ListStreams

func (k *Kinesis) ListStreams() (resp *ListStreamResponse, err error)

This operation returns an array of the names of all the streams that are associated with the AWS account making the ListStreams request.

func (*Kinesis) MergeShards

func (k *Kinesis) MergeShards(streamName, shardToMerge, adjacentShard string) error

This operation merges two adjacent shards in a stream and combines them into a single shard to reduce the stream's capacity to ingest and transport data.

func (*Kinesis) PutRecord

func (k *Kinesis) PutRecord(streamName, partitionKey string, data []byte, hashKey, sequenceNumber string) (resp *PutRecordResponse, err error)

This operation puts a data record into an Amazon Kinesis stream from a producer.

func (*Kinesis) PutRecords

func (k *Kinesis) PutRecords(streamName string, records []PutRecordsRequestEntry) (resp *PutRecordsResponse, err error)

This operation puts multiple data records into an Amazon Kinesis stream from a producer.

func (*Kinesis) SplitShard

func (k *Kinesis) SplitShard(streamName, shard, startingHashKey string) error

This operation splits a shard into two new shards in the stream, to increase the stream's capacity to ingest and transport data.

type ListStreamResponse

type ListStreamResponse struct {
	HasMoreStreams bool
	StreamNames    []string
}

Represents the output of a ListStreams operation.

type PutRecordResponse

type PutRecordResponse struct {
	SequenceNumber string
	ShardId        string
}

Represents the output of a PutRecord operation.

type PutRecordsRequestEntry

type PutRecordsRequestEntry struct {
	PartitionKey string
	HashKey      string `json:"ExplicitHashKey,omitempty"`
	Data         []byte
}

The unit of data put to the Amazon Kinesis stream by PutRecords, which includes a partition key, a hash key, and a data blob.

type PutRecordsResponse

type PutRecordsResponse struct {
	FailedRecordCount int
	Records           []PutRecordsResultEntry
}

Represents the output of a PutRecords operation.

type PutRecordsResultEntry

type PutRecordsResultEntry struct {
	ErrorCode      string
	ErrorMessage   string
	SequenceNumber string
	ShardId        string
}

type Query

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

func NewEmptyQuery

func NewEmptyQuery() *Query

func NewQueryWithStream

func NewQueryWithStream(streamName string) *Query

func (*Query) AddAdjacentShardToMerge

func (q *Query) AddAdjacentShardToMerge(shard string)

func (*Query) AddData

func (q *Query) AddData(data []byte)

func (*Query) AddExclusiveStartShardId

func (q *Query) AddExclusiveStartShardId(shardId string)

func (*Query) AddExplicitHashKey

func (q *Query) AddExplicitHashKey(hashKey string)

func (*Query) AddLimit

func (q *Query) AddLimit(limit int)

func (*Query) AddNewStartingHashKey

func (q *Query) AddNewStartingHashKey(hashKey string)

func (*Query) AddPartitionKey

func (q *Query) AddPartitionKey(partitionKey string)

func (*Query) AddRecords

func (q *Query) AddRecords(records []PutRecordsRequestEntry)

func (*Query) AddSequenceNumberForOrdering

func (q *Query) AddSequenceNumberForOrdering(sequenceNumber string)

func (*Query) AddShardCount

func (q *Query) AddShardCount(count int)

func (*Query) AddShardId

func (q *Query) AddShardId(id string)

func (*Query) AddShardIterator

func (q *Query) AddShardIterator(iterator string)

func (*Query) AddShardIteratorType

func (q *Query) AddShardIteratorType(t ShardIteratorType)

func (*Query) AddShardToMerge

func (q *Query) AddShardToMerge(shard string)

func (*Query) AddShardToSplit

func (q *Query) AddShardToSplit(shard string)

func (*Query) AddStartingSequenceNumber

func (q *Query) AddStartingSequenceNumber(sequenceNumber string)

func (*Query) AddStreamName

func (q *Query) AddStreamName(name string)

func (*Query) String

func (q *Query) String() string

type Record

type Record struct {
	Data           []byte
	PartitionKey   string
	SequenceNumber string
}

The unit of data of the Amazon Kinesis stream, which is composed of a sequence number, a partition key, and a data blob.

type SequenceNumberRange

type SequenceNumberRange struct {
	EndingSequenceNumber   string
	StartingSequenceNumber string
}

The range of possible sequence numbers for the shard.

func (SequenceNumberRange) String

func (s SequenceNumberRange) String() string

type Shard

type Shard struct {
	AdjacentParentShardId string
	HashKeyRange          HashKeyRange
	ParentShardId         string
	SequenceNumberRange   SequenceNumberRange
	ShardId               string
}

A uniquely identified group of data records in an Amazon Kinesis stream.

type ShardIteratorType

type ShardIteratorType string

type StreamDescription

type StreamDescription struct {
	HasMoreShards bool
	Shards        []Shard
	StreamARN     string
	StreamName    string
	StreamStatus  StreamStatus
}

Description of a Stream

type StreamStatus

type StreamStatus string

Jump to

Keyboard shortcuts

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