wrapper

package
v0.0.0-...-9a1dd84 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

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

type CompositeKey struct {
	PartitionKey Key
	SortKey      Key
}

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 Key

type Key struct {
	Id    string
	Value string
}

Key groups the ID and Value of a key

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

type SNSAPI

type SNSAPI interface {
	Publish(ctx context.Context,
		params *sns.PublishInput,
		optFns ...func(*sns.Options)) (*sns.PublishOutput, error)
}

Directories

Path Synopsis
Package mock_wrapper is a generated GoMock package.
Package mock_wrapper is a generated GoMock package.

Jump to

Keyboard shortcuts

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