clients

package
v0.0.0-...-abfb793 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAWSSession

func NewAWSSession() (*session.Session, error)

NewAWSSession creates an AWS session.

func NewECSClient

func NewECSClient(sess *session.Session) *ecs.ECS

func NewEtcdClient

func NewEtcdClient(endpoints []string) (*etcd.Client, error)

NewEtcdClient initializes an etcd client

func NewKinesisClient

func NewKinesisClient(session *session.Session) *kinesis.Kinesis

func NewSQSClient

func NewSQSClient(session *session.Session) *sqs.SQS

Types

type EtcdInterface

type EtcdInterface interface {
	// Close shuts down the client's etcd connections.
	Close() error

	// Put puts a key-value pair into etcd.
	// Note that key,value can be plain bytes array and string is
	// an immutable representation of that bytes array.
	// To get a string of bytes, do string([]byte(0x10, 0x20)).
	Put(ctx context.Context, key, val string, opts ...etcd.OpOption) (*etcd.PutResponse, error)

	// Get retrieves keys.
	// By default, Get will return the value for "key", if any.
	// When passed WithRange(end), Get will return the keys in the range [key, end).
	// When passed WithFromKey(), Get returns keys greater than or equal to key.
	// When passed WithRev(rev) with rev > 0, Get retrieves keys at the given revision;
	// if the required revision is compacted, the request will fail with ErrCompacted .
	// When passed WithLimit(limit), the number of returned keys is bounded by limit.
	// When passed WithSort(), the keys will be sorted.
	Get(ctx context.Context, key string, opts ...etcd.OpOption) (*etcd.GetResponse, error)

	// Watch watches on a key or prefix. The watched events will be returned
	// through the returned channel.
	// If the watch is slow or the required rev is compacted, the watch request
	// might be canceled from the server-side and the chan will be closed.
	// 'opts' can be: 'WithRev' and/or 'WithPrefix'.
	Watch(ctx context.Context, key string, opts ...etcd.OpOption) etcd.WatchChan

	// Delete deletes a key, or optionally using WithRange(end), [key, end).
	Delete(ctx context.Context, key string, opts ...etcd.OpOption) (*etcd.DeleteResponse, error)
}

EtcdInterface defines etcd methods that are used in the project to enable mocking

Jump to

Keyboard shortcuts

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