Documentation
¶
Overview ¶
Package interfaces provides abstractions for AWS SDK operations to enable mocking
Index ¶
- type DynamoDBClientInterface
- type DynamoDBClientWrapper
- func (w *DynamoDBClientWrapper) BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, ...) (*dynamodb.BatchGetItemOutput, error)
- func (w *DynamoDBClientWrapper) BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, ...) (*dynamodb.BatchWriteItemOutput, error)
- func (w *DynamoDBClientWrapper) CreateTable(ctx context.Context, params *dynamodb.CreateTableInput, ...) (*dynamodb.CreateTableOutput, error)
- func (w *DynamoDBClientWrapper) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, ...) (*dynamodb.DeleteItemOutput, error)
- func (w *DynamoDBClientWrapper) DeleteTable(ctx context.Context, params *dynamodb.DeleteTableInput, ...) (*dynamodb.DeleteTableOutput, error)
- func (w *DynamoDBClientWrapper) DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, ...) (*dynamodb.DescribeTableOutput, error)
- func (w *DynamoDBClientWrapper) GetItem(ctx context.Context, params *dynamodb.GetItemInput, ...) (*dynamodb.GetItemOutput, error)
- func (w *DynamoDBClientWrapper) PutItem(ctx context.Context, params *dynamodb.PutItemInput, ...) (*dynamodb.PutItemOutput, error)
- func (w *DynamoDBClientWrapper) Query(ctx context.Context, params *dynamodb.QueryInput, ...) (*dynamodb.QueryOutput, error)
- func (w *DynamoDBClientWrapper) Scan(ctx context.Context, params *dynamodb.ScanInput, ...) (*dynamodb.ScanOutput, error)
- func (w *DynamoDBClientWrapper) UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, ...) (*dynamodb.UpdateItemOutput, error)
- func (w *DynamoDBClientWrapper) UpdateTimeToLive(ctx context.Context, params *dynamodb.UpdateTimeToLiveInput, ...) (*dynamodb.UpdateTimeToLiveOutput, error)
- type TableExistsWaiterWrapper
- type TableNotExistsWaiterInterface
- type TableNotExistsWaiterWrapper
- type TableWaiterInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamoDBClientInterface ¶
type DynamoDBClientInterface interface {
// Table Management Operations
CreateTable(ctx context.Context, params *dynamodb.CreateTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.CreateTableOutput, error)
DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)
DeleteTable(ctx context.Context, params *dynamodb.DeleteTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteTableOutput, error)
UpdateTimeToLive(ctx context.Context, params *dynamodb.UpdateTimeToLiveInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateTimeToLiveOutput, error)
// Data Operations (for completeness)
GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)
UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)
}
DynamoDBClientInterface abstracts the AWS DynamoDB client operations that need to be mockable for testing infrastructure code.
type DynamoDBClientWrapper ¶
type DynamoDBClientWrapper struct {
// contains filtered or unexported fields
}
DynamoDBClientWrapper wraps the real AWS DynamoDB client to implement our interface
func NewDynamoDBClientWrapper ¶
func NewDynamoDBClientWrapper(client *dynamodb.Client) *DynamoDBClientWrapper
NewDynamoDBClientWrapper creates a new wrapper around the AWS DynamoDB client
func (*DynamoDBClientWrapper) BatchGetItem ¶
func (w *DynamoDBClientWrapper) BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
func (*DynamoDBClientWrapper) BatchWriteItem ¶
func (w *DynamoDBClientWrapper) BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)
func (*DynamoDBClientWrapper) CreateTable ¶
func (w *DynamoDBClientWrapper) CreateTable(ctx context.Context, params *dynamodb.CreateTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.CreateTableOutput, error)
Table Management Operations
func (*DynamoDBClientWrapper) DeleteItem ¶
func (w *DynamoDBClientWrapper) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
func (*DynamoDBClientWrapper) DeleteTable ¶
func (w *DynamoDBClientWrapper) DeleteTable(ctx context.Context, params *dynamodb.DeleteTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteTableOutput, error)
func (*DynamoDBClientWrapper) DescribeTable ¶
func (w *DynamoDBClientWrapper) DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)
func (*DynamoDBClientWrapper) GetItem ¶
func (w *DynamoDBClientWrapper) GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
Data Operations
func (*DynamoDBClientWrapper) PutItem ¶
func (w *DynamoDBClientWrapper) PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
func (*DynamoDBClientWrapper) Query ¶
func (w *DynamoDBClientWrapper) Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
func (*DynamoDBClientWrapper) Scan ¶
func (w *DynamoDBClientWrapper) Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)
func (*DynamoDBClientWrapper) UpdateItem ¶
func (w *DynamoDBClientWrapper) UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
func (*DynamoDBClientWrapper) UpdateTimeToLive ¶
func (w *DynamoDBClientWrapper) UpdateTimeToLive(ctx context.Context, params *dynamodb.UpdateTimeToLiveInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateTimeToLiveOutput, error)
type TableExistsWaiterWrapper ¶
type TableExistsWaiterWrapper struct {
// contains filtered or unexported fields
}
TableExistsWaiterWrapper wraps the real AWS table exists waiter
func NewTableExistsWaiterWrapper ¶
func NewTableExistsWaiterWrapper(client *dynamodb.Client) *TableExistsWaiterWrapper
NewTableExistsWaiterWrapper creates a new wrapper around the AWS table exists waiter
func (*TableExistsWaiterWrapper) Wait ¶
func (w *TableExistsWaiterWrapper) Wait(ctx context.Context, params *dynamodb.DescribeTableInput, maxWaitDur time.Duration, optFns ...func(*dynamodb.TableExistsWaiterOptions)) error
type TableNotExistsWaiterInterface ¶
type TableNotExistsWaiterInterface interface {
// Wait waits for a table to be deleted
Wait(ctx context.Context, params *dynamodb.DescribeTableInput, maxWaitDur time.Duration, optFns ...func(*dynamodb.TableNotExistsWaiterOptions)) error
}
TableNotExistsWaiterInterface abstracts DynamoDB table not exists waiters for mocking
type TableNotExistsWaiterWrapper ¶
type TableNotExistsWaiterWrapper struct {
// contains filtered or unexported fields
}
TableNotExistsWaiterWrapper wraps the real AWS table not exists waiter
func NewTableNotExistsWaiterWrapper ¶
func NewTableNotExistsWaiterWrapper(client *dynamodb.Client) *TableNotExistsWaiterWrapper
NewTableNotExistsWaiterWrapper creates a new wrapper around the AWS table not exists waiter
func (*TableNotExistsWaiterWrapper) Wait ¶
func (w *TableNotExistsWaiterWrapper) Wait(ctx context.Context, params *dynamodb.DescribeTableInput, maxWaitDur time.Duration, optFns ...func(*dynamodb.TableNotExistsWaiterOptions)) error
type TableWaiterInterface ¶
type TableWaiterInterface interface {
// Wait waits for a table to reach the desired state
Wait(ctx context.Context, params *dynamodb.DescribeTableInput, maxWaitDur time.Duration, optFns ...func(*dynamodb.TableExistsWaiterOptions)) error
}
TableWaiterInterface abstracts DynamoDB table waiters for mocking