Documentation ¶
Index ¶
- func AwsSetQueueTimeout(svc *sqs.Client, envURL *url.URL, queueURL *string) error
- func GetTimeoutFromURL(qURL *url.URL) string
- func NewAwsConfig() aws.Config
- func ResetMqInMemoryDynamoDb()
- func ResetQueueInMemory()
- type AppRes
- type Bucket
- func (b *Bucket) Begin() error
- func (b *Bucket) Commit() error
- func (b *Bucket) Del(name string) error
- func (b *Bucket) Exists(name string) (bool, error)
- func (b *Bucket) Get(name string) (interface{}, error)
- func (b *Bucket) Put(name string, item interface{}) error
- func (b *Bucket) Rollback() error
- type Ddb
- type Dir
- type DynamoDb
- func (ddb *DynamoDb) Begin() error
- func (ddb *DynamoDb) Commit() error
- func (ddb *DynamoDb) CreateTable(input *dynamodb.CreateTableInput) error
- func (ddb *DynamoDb) Del(tableName string, key map[string]string) error
- func (ddb *DynamoDb) Get(tableName string, key map[string]string) (map[string]types.AttributeValue, error)
- func (ddb *DynamoDb) ListTables() ([]string, error)
- func (ddb *DynamoDb) Put(tableName string, item interface{}) error
- func (ddb *DynamoDb) PutConditional(tableName string, item interface{}, condition *string, ...) error
- func (ddb *DynamoDb) Query(queryInput *dynamodb.QueryInput) ([]map[string]types.AttributeValue, error)
- func (ddb *DynamoDb) Rollback() error
- func (ddb *DynamoDb) Scan(tableName string, filter expression.ConditionBuilder) ([]map[string]types.AttributeValue, error)
- type DynamoDbItemNotFound
- type FS
- type FileSystem
- type InMemKeyVal
- func (r *InMemKeyVal) Begin() error
- func (r *InMemKeyVal) Commit() error
- func (r *InMemKeyVal) Del(key string) error
- func (r *InMemKeyVal) Exists(key string) (bool, error)
- func (r *InMemKeyVal) Get(key string) (interface{}, error)
- func (r *InMemKeyVal) Put(key string, item interface{}) error
- func (r *InMemKeyVal) Rollback() error
- type KeyVal
- type MqInMemoryDynamoDb
- func (ddb *MqInMemoryDynamoDb) Begin() error
- func (ddb *MqInMemoryDynamoDb) Commit() error
- func (ddb *MqInMemoryDynamoDb) CreateTable(input *dynamodb.CreateTableInput) error
- func (ddb *MqInMemoryDynamoDb) Get(tableName string, key map[string]string) (map[string]types.AttributeValue, error)
- func (ddb *MqInMemoryDynamoDb) ListTables() ([]string, error)
- func (ddb *MqInMemoryDynamoDb) Put(tableName string, item interface{}) error
- func (ddb *MqInMemoryDynamoDb) Rollback() error
- type Publisher
- type PublisherInMemory
- type PublisherSns
- type Queue
- type QueueBeanstalk
- type QueueInMemory
- func (mq *QueueInMemory) Begin() error
- func (mq *QueueInMemory) Commit() error
- func (mq *QueueInMemory) Init() error
- func (mq *QueueInMemory) Move(fromS string, toS string)
- func (mq *QueueInMemory) Name() string
- func (mq *QueueInMemory) Retrieve() (*string, error)
- func (mq *QueueInMemory) Rollback() error
- func (mq *QueueInMemory) Send(payload string) error
- type QueueSqs
- type Redis
- type S3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwsSetQueueTimeout ¶
// NewAwsConfigForSQS configures aws connection
func NewAwsConfigForSQS() aws.Config { awsEndpoint := os.Getenv("AWS_ENDPOINT_SQS") return NewAwsConfig(awsEndpoint) }
// NewAwsConfigForS3 configures aws connection
func NewAwsConfigForS3() aws.Config { awsEndpoint := os.Getenv("AWS_ENDPOINT_S3") return NewAwsConfig(awsEndpoint) }
// NewAwsConfigForSNS configures aws connection
func NewAwsConfigForSNS() aws.Config { awsEndpoint := os.Getenv("AWS_ENDPOINT_SNS") return NewAwsConfig(awsEndpoint) }
// NewAwsConfigForDDB configures aws connection
func NewAwsConfigForDDB() aws.Config { awsEndpoint := os.Getenv("AWS_ENDPOINT_DDB") return NewAwsConfig(awsEndpoint) }
AwsSetQueueTimeout sets timeout for sqs queue
func GetTimeoutFromURL ¶
GetTimeoutFromURL retrieve value from querystring parameter timeout
func ResetMqInMemoryDynamoDb ¶
func ResetMqInMemoryDynamoDb()
ResetMqInMemoryDynamoDb resets the singleton
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket wrapper for S3 Bucket
type Ddb ¶
type Ddb interface { CreateTable(input *dynamodb.CreateTableInput) error ListTables() ([]string, error) Put(tableName string, item interface{}) error PutConditional(tableName string, item interface{}, condition *string, conditionAttributes map[string]interface{}) error Get(tableName string, key map[string]string) (map[string]types.AttributeValue, error) Del(tableName string, key map[string]string) error Query(queryInput *dynamodb.QueryInput) ([]map[string]types.AttributeValue, error) Scan(tableName string, filter expression.ConditionBuilder) ([]map[string]types.AttributeValue, error) }
Ddb interface for allowing swap outs for testing
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir is a wrapper for a directory
type DynamoDb ¶
type DynamoDb struct {
// contains filtered or unexported fields
}
DynamoDb is a wrapper for AWS DynamoDb
func NewDynamoDb ¶
NewDynamoDb return a configured DynamoDb Resource
func (*DynamoDb) CreateTable ¶
func (ddb *DynamoDb) CreateTable(input *dynamodb.CreateTableInput) error
CreateTable is a wrapper for creating S3 Tables
func (*DynamoDb) Get ¶
func (ddb *DynamoDb) Get(tableName string, key map[string]string) (map[string]types.AttributeValue, error)
Get is a wrapper for getting data from a DynamoDb table
func (*DynamoDb) ListTables ¶
ListTables is a wrapper for listing S3 Tables
func (*DynamoDb) PutConditional ¶ added in v0.0.54
func (ddb *DynamoDb) PutConditional(tableName string, item interface{}, condition *string, conditionAttributes map[string]interface{}) error
PutConditional is a wrapper for putting data in a DynamoDb table
func (*DynamoDb) Query ¶ added in v0.0.54
func (ddb *DynamoDb) Query(queryInput *dynamodb.QueryInput) ([]map[string]types.AttributeValue, error)
Query is a wrapper for getting data from a DynamoDb table
func (*DynamoDb) Scan ¶ added in v0.0.54
func (ddb *DynamoDb) Scan(tableName string, filter expression.ConditionBuilder) ([]map[string]types.AttributeValue, error)
Scan is a wrapper for getting data from a DynamoDb table
type DynamoDbItemNotFound ¶ added in v0.0.33
type DynamoDbItemNotFound struct { TableName string Key interface{} }
DynamoDbItemNotFound is a signal
func (*DynamoDbItemNotFound) Error ¶ added in v0.0.33
func (e *DynamoDbItemNotFound) Error() string
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS is a wrapper for a file
type FileSystem ¶
type FileSystem interface { Put(path string, name string, payload []byte) error Get(path string, name string) ([]byte, error) Del(path string, name string) error }
FileSystem interface for allowing swap outs for testing
type InMemKeyVal ¶
type InMemKeyVal struct {
// contains filtered or unexported fields
}
InMemKeyVal is swap in unit testing involving calls to KeyVal stores
func NewInMemKeyVal ¶
func NewInMemKeyVal(url *url.URL) *InMemKeyVal
NewInMemKeyVal returns a configured In Memory Key Value App Resource
func (*InMemKeyVal) Del ¶
func (r *InMemKeyVal) Del(key string) error
Del wrapper for InMemory Key Value Store
func (*InMemKeyVal) Exists ¶
func (r *InMemKeyVal) Exists(key string) (bool, error)
Exists wrapper for InMemory Key Value Store
func (*InMemKeyVal) Get ¶
func (r *InMemKeyVal) Get(key string) (interface{}, error)
Get wrapper for InMemory Key Value Store
func (*InMemKeyVal) Put ¶
func (r *InMemKeyVal) Put(key string, item interface{}) error
Put wrapper for InMemory Key Value Store
type KeyVal ¶
type KeyVal interface { Put(key string, item interface{}) error Exists(key string) (bool, error) Get(key string) (interface{}, error) Del(key string) error }
KeyVal interface for allowing swap outs for testing
type MqInMemoryDynamoDb ¶
type MqInMemoryDynamoDb struct { TableNames []string List []interface{} // contains filtered or unexported fields }
MqInMemoryDynamoDb is swap in unit testing involving calls to DynamoDb
func NewMqInMemoryDynamoDb ¶
func NewMqInMemoryDynamoDb(url *url.URL) *MqInMemoryDynamoDb
NewMqInMemoryDynamoDb returns the singleton, creating if necessary
func NewMqInMemoryDynamoDbFromString ¶
func NewMqInMemoryDynamoDbFromString(urlString string) *MqInMemoryDynamoDb
NewMqInMemoryDynamoDbFromString is an adapter for NewMqInMemoryDynamoDb
func (*MqInMemoryDynamoDb) Commit ¶
func (ddb *MqInMemoryDynamoDb) Commit() error
Commit transaction
func (*MqInMemoryDynamoDb) CreateTable ¶
func (ddb *MqInMemoryDynamoDb) CreateTable(input *dynamodb.CreateTableInput) error
CreateTable is a wrapper for creating mock S3 Tables
func (*MqInMemoryDynamoDb) Get ¶
func (ddb *MqInMemoryDynamoDb) Get(tableName string, key map[string]string) (map[string]types.AttributeValue, error)
Get is a wrapper for getting data from mock S3 Tables
func (*MqInMemoryDynamoDb) ListTables ¶
func (ddb *MqInMemoryDynamoDb) ListTables() ([]string, error)
ListTables is a wrapper for listing mock S3 Tables
func (*MqInMemoryDynamoDb) Put ¶
func (ddb *MqInMemoryDynamoDb) Put(tableName string, item interface{}) error
Put is a wrapper for putting data into mock S3 Tables
func (*MqInMemoryDynamoDb) Rollback ¶
func (ddb *MqInMemoryDynamoDb) Rollback() error
Rollback transaction
type Publisher ¶ added in v0.0.47
Publisher is the generic interface to a Publisher
func NewPublisher ¶ added in v0.0.47
NewPublisher allows Publishers to be created and returned, based on the url string provided.
type PublisherInMemory ¶ added in v0.0.47
type PublisherInMemory struct { List []string // contains filtered or unexported fields }
PublisherInMemory is a wrapper for a AWS SNS Topic
func NewPublisherInMemory ¶ added in v0.0.47
func NewPublisherInMemory(url *url.URL) *PublisherInMemory
NewPublisherInMemory returns an InMemory Publisher for testing purposes
func (*PublisherInMemory) Begin ¶ added in v0.0.47
func (p *PublisherInMemory) Begin() error
Begin transaction
func (*PublisherInMemory) Commit ¶ added in v0.0.47
func (p *PublisherInMemory) Commit() error
Commit transaction
func (*PublisherInMemory) Name ¶ added in v0.0.47
func (p *PublisherInMemory) Name() string
Name returns the name of the wrapped queue
func (*PublisherInMemory) Publish ¶ added in v0.0.47
func (p *PublisherInMemory) Publish(Message string) error
Publish wrapper for AWS SNS Topic
func (*PublisherInMemory) Rollback ¶ added in v0.0.47
func (p *PublisherInMemory) Rollback() error
Rollback transaction
type PublisherSns ¶ added in v0.0.47
type PublisherSns struct {
// contains filtered or unexported fields
}
PublisherSns is a wrapper for a AWS SNS Topic
func NewPublisherSns ¶ added in v0.0.47
func NewPublisherSns(url *url.URL) *PublisherSns
NewPublisherSns returns a configured Sqs App Resource
func (*PublisherSns) Begin ¶ added in v0.0.47
func (q *PublisherSns) Begin() error
Begin transaction
func (*PublisherSns) Commit ¶ added in v0.0.47
func (q *PublisherSns) Commit() error
Commit transaction
func (*PublisherSns) Name ¶ added in v0.0.47
func (q *PublisherSns) Name() string
Name returns the name of the wrapped queue
func (*PublisherSns) Publish ¶ added in v0.0.47
func (q *PublisherSns) Publish(Message string) error
Publish wrapper for AWS SNS Topic
func (*PublisherSns) Rollback ¶ added in v0.0.47
func (q *PublisherSns) Rollback() error
Rollback transaction
type Queue ¶
type Queue interface { Name() string Send(payload string) error Retrieve() (*string, error) Commit() error }
Queue is the generic interface to a queue
type QueueBeanstalk ¶
type QueueBeanstalk struct {
// contains filtered or unexported fields
}
QueueBeanstalk is a wrapper for a Beanstalk tube
func NewQueueBeanstalk ¶
func NewQueueBeanstalk(url *url.URL) *QueueBeanstalk
NewQueueBeanstalk returns a configured Beanstalk App Resource
func (*QueueBeanstalk) Name ¶
func (q *QueueBeanstalk) Name() string
Name returns the name of the wrapped queue
func (*QueueBeanstalk) Retrieve ¶
func (q *QueueBeanstalk) Retrieve() (*string, error)
Retrieve wrapper for Beanstalk Queue
func (*QueueBeanstalk) Send ¶
func (q *QueueBeanstalk) Send(payload string) error
Send wrapper for Beanstalk Queue
type QueueInMemory ¶
type QueueInMemory struct { List []string // contains filtered or unexported fields }
QueueInMemory swap in queue for testing
func NewQueueInMemory ¶
func NewQueueInMemory(url *url.URL) *QueueInMemory
NewQueueInMemory returns the singleton, creating if necessary
func NewQueueInMemoryFromString ¶
func NewQueueInMemoryFromString(urlString string) *QueueInMemory
NewQueueInMemoryFromString adapter for NewQueueInMemory
func (*QueueInMemory) Move ¶
func (mq *QueueInMemory) Move(fromS string, toS string)
Move message to a different queue
func (*QueueInMemory) Retrieve ¶
func (mq *QueueInMemory) Retrieve() (*string, error)
Retrieve wrapper for InMemory Queue
func (*QueueInMemory) Send ¶
func (mq *QueueInMemory) Send(payload string) error
Send wrapper for InMemory Queue
type QueueSqs ¶
type QueueSqs struct {
// contains filtered or unexported fields
}
QueueSqs is a wrapper for a AWS SQS Queue
func NewQueueSqs ¶
NewQueueSqs returns a configured Sqs App Resource
func (*QueueSqs) CreateQueue ¶
func (q *QueueSqs) CreateQueue()
CreateQueue ensures the named queue exists
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis is a wrapper for a Redis