ddbtest

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Constrains

func Constrains[T dynamo.Thing](
	returnVal map[string]types.AttributeValue,
) dynamo.KeyVal[T]

func DeleteItem

func DeleteItem[T dynamo.Thing](
	expectKey *map[string]types.AttributeValue,
	returnVal *map[string]types.AttributeValue,
) dynamo.KeyVal[T]

DeleteItem mock

func GetItem

func GetItem[T dynamo.Thing](
	expectKey *map[string]types.AttributeValue,
	returnVal *map[string]types.AttributeValue,
) dynamo.KeyVal[T]

GetItem mocks

func PutItem

func PutItem[T dynamo.Thing](
	expectVal *map[string]types.AttributeValue,
) dynamo.KeyVal[T]

PutItem mock

func Query

func Query[T dynamo.Thing](
	expectKey *map[string]types.AttributeValue,
	returnLen int,
	returnVal *map[string]types.AttributeValue,
	returnLastKey *map[string]types.AttributeValue,
) dynamo.KeyVal[T]

Query mock

func UpdateItem

func UpdateItem[T dynamo.Thing](
	expectKey *map[string]types.AttributeValue,
	expectVal *map[string]types.AttributeValue,
	returnVal *map[string]types.AttributeValue,
) dynamo.KeyVal[T]

UpdateItem mock

Types

type BatchGetItem added in v3.0.6

type BatchGetItem struct {
	Mock[dynamodb.BatchGetItemInput, dynamodb.BatchGetItemOutput]
}

func (BatchGetItem) BatchGetItem added in v3.0.6

func (mock BatchGetItem) BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, opts ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)

type BatchWriteItem added in v3.0.6

func (BatchWriteItem) BatchWriteItem added in v3.0.6

func (mock BatchWriteItem) BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, opts ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)

type Mock added in v3.0.6

type Mock[A, B any] struct {
	ddbapi.DynamoDB
	ExpectVal *A
	ReturnVal *B
	ReturnErr error
}

Jump to

Keyboard shortcuts

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