예제 #1
0
func (k *kinesis) refreshClient(accessKey, secretKey, region string) error {
	credentials, err := authenticate(accessKey, secretKey)
	if err != nil {
		return err
	}
	k.client = gokinesis.New(credentials, region)
	return nil
}
예제 #2
0
func (k *kinesis) init(stream, shard, shardIteratorType, accessKey, secretKey, region string) (*kinesis, error) {

	auth, err := authenticate(accessKey, secretKey)
	k = &kinesis{
		stream:            stream,
		shard:             shard,
		shardIteratorType: shardIteratorType,
		client:            gokinesis.New(auth, region),
	}
	if err != nil {
		return k, err
	}

	err = k.initShardIterator()
	if err != nil {
		return k, err
	}

	return k, nil
}