Documentation
¶
Overview ¶
Package streams is a client for DynamoDB Streams within Dynago.
This provides access to the DynamoDB streams API with all the conveniences that one would expect from using Dynago: document unmarshaling to go types, clean API's and a way to write applications simply.
Despite what is said above, this package is still a low-level interface to the DynamoDB streams API calls, which is a bit more clumsy to use than the higher level interface, which is available at http://godoc.org/github.com/crast/dynatools/streamer
Index ¶
- type Client
- type Config
- type DescribeStreamRequest
- type DescribeStreamResponse
- type GetIteratorRequest
- type GetIteratorResult
- type GetRecordsRequest
- type GetRecordsResponse
- type IteratorType
- type MakeRequester
- type Record
- type SequenceNumberRange
- type Shard
- type Stream
- type StreamDescription
- type StreamRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the low-level interface to the streams API.
Here, all the individual Streams API requests are available. Because this is a low-level client package, the main aim is to provide mappings for the core API calls needed to implement streaming.
For more information on how the API's interact, check out: http://docs.aws.amazon.com/dynamodbstreams/latest/APIReference/Welcome.html
func (*Client) DescribeStream ¶
func (s *Client) DescribeStream(request *DescribeStreamRequest) (dest *DescribeStreamResponse, err error)
DescribeStream gets metadata about a stream and information about its shards.
func (*Client) GetRecords ¶
func (s *Client) GetRecords(req *GetRecordsRequest) (result *GetRecordsResponse, err error)
GetRecords will get the next set of records inside a DynamoDB streams shard.
An empty set of records does not mean the stream is complete; only the absence of an iterator signals completion of a stream shard (such as the shard is now closed for new data)
func (*Client) GetShardIterator ¶
func (s *Client) GetShardIterator(req *GetIteratorRequest) (dest *GetIteratorResult, err error)
GetShardIterator is required to get a valid iterator before you begin streaming.
type Config ¶
type Config struct { // Must implement MakeRequestUnmarshal. The easiest thing to use in this // case is an instance of dynago.AwsExecutor or the like. Requester MakeRequester }
Config is configuration for a streams client.
type DescribeStreamRequest ¶
type DescribeStreamResponse ¶
type DescribeStreamResponse struct {
StreamDescription StreamDescription
}
type GetIteratorRequest ¶
type GetIteratorRequest struct { StreamArn string ShardId string ShardIteratorType IteratorType SequenceNumber string `json:",omitempty"` }
type GetIteratorResult ¶
type GetIteratorResult struct {
ShardIterator string
}
type GetRecordsRequest ¶
type GetRecordsResponse ¶
type IteratorType ¶
type IteratorType string
IteratorType controls where to start in a stream.
const ( IteratorAtSequence IteratorType = "AT_SEQUENCE_NUMBER" IteratorAfterSequence IteratorType = "AFTER_SEQUENCE_NUMBER" IteratorTrimHorizon IteratorType = "TRIM_HORIZON" IteratorLatest IteratorType = "LATEST" )
type MakeRequester ¶
type MakeRequester interface {
MakeRequestUnmarshal(method string, document interface{}, dest interface{}) (err error)
}
MakeRequester is Equivalent to the dynago version
type Record ¶
type Record struct { StreamRecord `json:"dynamodb"` AwsRegion string EventId string EventName string EventSource string EventVersion string }
Record is a description of a unique event within a stream.
type SequenceNumberRange ¶
SequenceNumberRange is information about sequence numbers in a stream
type Shard ¶
type Shard struct { ParentShardId string SequenceNumberRange SequenceNumberRange ShardId string }
Shard describes one of the shards of a stream
type StreamDescription ¶
type StreamDescription struct { Stream KeySchema []schema.KeySchema Shards []Shard StreamStatus string StreamViewType string CreationRequestDateTime float64 LastEvaluatedShardId string }
StreamDescription is the main response value from DescribeStream
type StreamRecord ¶
type StreamRecord struct { Keys dynago.Document OldImage dynago.Document NewImage dynago.Document SequenceNumber string SizeBytes uint64 StreamViewType string }
StreamRecord is a description of a single data modification that was performed on an item in a DynamoDB table.