Documentation ¶
Overview ¶
Package provide GOlang API for http://aws.amazon.com/kinesis/
Index ¶
- Constants
- Variables
- func GetRegion(region Region) string
- func Sign(authKeys *Auth, r *http.Request) error
- type Auth
- type Client
- type DescribeStreamResp
- type DescribeStreamShards
- type Error
- type GetRecordsRecords
- type GetRecordsResp
- type GetShardIteratorResp
- type Kinesis
- func (kinesis *Kinesis) CreateStream(StreamName string, ShardCount int) error
- func (kinesis *Kinesis) DeleteStream(StreamName string) error
- func (kinesis *Kinesis) DescribeStream(args *RequestArgs) (resp *DescribeStreamResp, err error)
- func (kinesis *Kinesis) GetRecords(args *RequestArgs) (resp *GetRecordsResp, err error)
- func (kinesis *Kinesis) GetShardIterator(args *RequestArgs) (resp *GetShardIteratorResp, err error)
- func (kinesis *Kinesis) ListStreams(args *RequestArgs) (resp *ListStreamsResp, err error)
- func (kinesis *Kinesis) MergeShards(args *RequestArgs) error
- func (kinesis *Kinesis) PutRecord(args *RequestArgs) (resp *PutRecordResp, err error)
- func (kinesis *Kinesis) SplitShard(args *RequestArgs) error
- type KinesisClient
- type ListStreamsResp
- type PutRecordResp
- type Region
- type RequestArgs
- type Service
Constants ¶
const ( ACCESS_ENV_KEY = "AWS_ACCESS_KEY" SECRET_ENV_KEY = "AWS_SECRET_KEY" REGION_ENV_NAME = "AWS_REGION_NAME" )
const (
ACTION_KEY = "Action"
)
const (
AWS4_URL = "aws4_request"
)
Variables ¶
var EUWest = Region{"eu-west-1"}
var USEast = Region{"us-east-1"}
var USWest2 = Region{"us-west-2"}
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
AccessKey, SecretKey, Token string
}
Auth store information about AWS Credentials
type Client ¶
type Client struct { Auth *Auth // The http client to make requests with. If nil, http.DefaultClient is used. Client *http.Client }
Client is like http.Client, but signs all requests using Auth.
type DescribeStreamResp ¶
type DescribeStreamResp struct { StreamDescription struct { HasMoreShards bool Shards []DescribeStreamShards StreamARN string StreamName string StreamStatus string } }
DescribeStreamResp stores the information that provides by DescribeStream API call
type DescribeStreamShards ¶
type DescribeStreamShards struct { AdjacentParentShardId string HashKeyRange struct { EndingHashKey string StartingHashKey string } ParentShardId string SequenceNumberRange struct { EndingSequenceNumber string StartingSequenceNumber string } ShardId string }
DescribeStreamShards stores the information about list of shards inside DescribeStreamResp
type Error ¶
type Error struct { // HTTP status code (200, 403, ...) StatusCode int // error code ("UnsupportedOperation", ...) Code string // The human-oriented error message Message string RequestId string }
Error represent error from Kinesis API
type GetRecordsRecords ¶
GetNextRecordsRecords stores the information that provides by GetNextRecordsResp
func (GetRecordsRecords) GetData ¶
func (r GetRecordsRecords) GetData() ([]byte, error)
type GetRecordsResp ¶
type GetRecordsResp struct { NextShardIterator string Records []GetRecordsRecords }
GetNextRecordsResp stores the information that provides by GetNextRecords API call
type GetShardIteratorResp ¶
type GetShardIteratorResp struct {
ShardIterator string
}
GetShardIteratorResp stores the information that provides by GetShardIterator API call
type Kinesis ¶
Structure for kinesis client
func (*Kinesis) CreateStream ¶
CreateStream adds a new Amazon Kinesis stream to your AWS account StreamName is a name of stream, ShardCount is number of shards more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_CreateStream.html
func (*Kinesis) DeleteStream ¶
DeleteStream deletes a stream and all of its shards and data from your AWS account StreamName is a name of stream more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_DeleteStream.html
func (*Kinesis) DescribeStream ¶
func (kinesis *Kinesis) DescribeStream(args *RequestArgs) (resp *DescribeStreamResp, err error)
DescribeStream 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. For each shard object there is information about the hash key and sequence number ranges that the shard spans, and the IDs of any earlier shards that played in a role in a MergeShards or SplitShard operation that created the shard more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_DescribeStream.html
func (*Kinesis) GetRecords ¶
func (kinesis *Kinesis) GetRecords(args *RequestArgs) (resp *GetRecordsResp, err error)
GetRecords returns one or more data records from a shard more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html
func (*Kinesis) GetShardIterator ¶
func (kinesis *Kinesis) GetShardIterator(args *RequestArgs) (resp *GetShardIteratorResp, err error)
GetShardIterator returns a shard iterator more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html
func (*Kinesis) ListStreams ¶
func (kinesis *Kinesis) ListStreams(args *RequestArgs) (resp *ListStreamsResp, err error)
ListStreams returns an array of the names of all the streams that are associated with the AWS account making the ListStreams request more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListStreams.html
func (*Kinesis) MergeShards ¶
func (kinesis *Kinesis) MergeShards(args *RequestArgs) error
MergeShards 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 more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_MergeShards.html
func (*Kinesis) PutRecord ¶
func (kinesis *Kinesis) PutRecord(args *RequestArgs) (resp *PutRecordResp, err error)
PutRecord puts a data record into an Amazon Kinesis stream from a producer more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html
func (*Kinesis) SplitShard ¶
func (kinesis *Kinesis) SplitShard(args *RequestArgs) error
SplitShard splits a shard into two new shards in the stream, to increase the stream's capacity to ingest and transport data more info http://docs.aws.amazon.com/kinesis/latest/APIReference/API_SplitShard.html
type KinesisClient ¶
type KinesisClient interface { CreateStream(StreamName string, ShardCount int) error DeleteStream(StreamName string) error MergeShards(args *RequestArgs) error SplitShard(args *RequestArgs) error ListStreams(args *RequestArgs) (resp *ListStreamsResp, err error) DescribeStream(args *RequestArgs) (resp *DescribeStreamResp, err error) GetShardIterator(args *RequestArgs) (resp *GetShardIteratorResp, err error) GetRecords(args *RequestArgs) (resp *GetRecordsResp, err error) PutRecord(args *RequestArgs) (resp *PutRecordResp, err error) }
Interface implemented by Kinesis
type ListStreamsResp ¶
ListStreamsResp stores the information that provides by ListStreams API call
type PutRecordResp ¶
PutRecordResp stores the information that provides by PutRecord API call
type RequestArgs ¶
type RequestArgs struct {
// contains filtered or unexported fields
}
RequestArgs store params for request
func (*RequestArgs) Add ¶
func (f *RequestArgs) Add(name string, value interface{})
Add appends a filtering parameter with the given name and value(s).
func (*RequestArgs) AddData ¶
func (f *RequestArgs) AddData(value []byte)