Documentation ¶
Index ¶
- func MockGetItem(t *testing.T, dynamoMock *mock_wrapper.MockDynamoDBAPI, table string, ...)
- func MockQuery(dynamoMock *mock_wrapper.MockDynamoDBAPI, ...)
- func MockScan(dynamoMock *mock_wrapper.MockDynamoDBAPI, ...)
- type CompositeKey
- type DynamoDBAPI
- type DynamoDBWrapper
- func (wrapper *DynamoDBWrapper) BuildUpdateQuery(fields ...string) string
- func (wrapper *DynamoDBWrapper) EmptySpecification() QuerySpecification
- func (wrapper *DynamoDBWrapper) GetItem(key KeyAttribute, value interface{}) error
- func (wrapper *DynamoDBWrapper) QueryDynamoDB(ctx context.Context, specification QuerySpecification) (*dynamodb.QueryOutput, error)
- func (wrapper *DynamoDBWrapper) SaveItem(ctx context.Context, item interface{}) error
- func (wrapper *DynamoDBWrapper) ScanDynamoDB(ctx context.Context, specification QuerySpecification) (*dynamodb.ScanOutput, error)
- type ExpressionBuilder
- type Key
- type KeyAttribute
- type PrimaryKey
- type QuerySpecification
- type S3APIWrapper
- type SESAPI
- type SNSAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockGetItem ¶
func MockGetItem(t *testing.T, dynamoMock *mock_wrapper.MockDynamoDBAPI, table string, key KeyAttribute, item map[string]types.AttributeValue, err error)
func MockQuery ¶
func MockQuery(dynamoMock *mock_wrapper.MockDynamoDBAPI, items []map[string]types.AttributeValue, err error)
func MockScan ¶
func MockScan(dynamoMock *mock_wrapper.MockDynamoDBAPI, items []map[string]types.AttributeValue, err error)
Types ¶
type CompositeKey ¶
CompositeKey groups a partition and sort key
type DynamoDBAPI ¶
type DynamoDBAPI interface { PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error) GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error) Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error) Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error) UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error) }
type DynamoDBWrapper ¶
type DynamoDBWrapper struct {
// contains filtered or unexported fields
}
func NewDynamoDBWrapper ¶
func NewDynamoDBWrapper(api DynamoDBAPI, table string) *DynamoDBWrapper
func (*DynamoDBWrapper) BuildUpdateQuery ¶
func (wrapper *DynamoDBWrapper) BuildUpdateQuery(fields ...string) string
func (*DynamoDBWrapper) EmptySpecification ¶
func (wrapper *DynamoDBWrapper) EmptySpecification() QuerySpecification
func (*DynamoDBWrapper) GetItem ¶
func (wrapper *DynamoDBWrapper) GetItem(key KeyAttribute, value interface{}) error
func (*DynamoDBWrapper) QueryDynamoDB ¶
func (wrapper *DynamoDBWrapper) QueryDynamoDB(ctx context.Context, specification QuerySpecification) (*dynamodb.QueryOutput, error)
func (*DynamoDBWrapper) SaveItem ¶
func (wrapper *DynamoDBWrapper) SaveItem(ctx context.Context, item interface{}) error
func (*DynamoDBWrapper) ScanDynamoDB ¶
func (wrapper *DynamoDBWrapper) ScanDynamoDB(ctx context.Context, specification QuerySpecification) (*dynamodb.ScanOutput, error)
type ExpressionBuilder ¶
type ExpressionBuilder struct { Index string expression.Builder }
type KeyAttribute ¶
type KeyAttribute interface {
// contains filtered or unexported methods
}
KeyAttribute interface provides a conversion from Key to map[string]types.AttributeValue
type PrimaryKey ¶
type PrimaryKey struct {
Key
}
PrimaryKey wraps Key for scenarios where exist only the Partition key
type QuerySpecification ¶
type QuerySpecification func(ctx context.Context, builderExpression expression.Builder) ExpressionBuilder
type S3APIWrapper ¶
type S3APIWrapper interface { PutObject(ctx context.Context, key string, data []byte) error PresignGetObject(ctx context.Context, key string) (string, error) }
func NewS3APIWrapper ¶
func NewS3APIWrapper(api s3API, bucket string, s3SignedAPI s3SignedAPI) S3APIWrapper
type SESAPI ¶
type SESAPI interface {
SendEmail(input *sesv2.SendEmailInput) (*sesv2.SendEmailOutput, error)
}
func NewMockSESAPI ¶
func NewMockSESAPI() SESAPI
Click to show internal directories.
Click to hide internal directories.