awsdynamodb

package
v0.0.0-...-1bc5079 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllQuery

func AllQuery(ctx context.Context, client DYQueryAPI, table *string, keyCondition expression.KeyConditionBuilder, filter ...expression.ConditionBuilder) ([]map[string]types.AttributeValue, error)

AllQuery will accept at most one filter

func PutItem

func PutItem(ctx context.Context, Client DyPutItemAPI, table *string, data DYPayload) error

PutItem defines common methods for putting data into dynamodb

func UpdateItem

func UpdateItem(ctx context.Context, Client DYUpdateItemAPI, table *string, key map[string]types.AttributeValue, field expression.UpdateBuilder) error

Types

type DYPayload

type DYPayload interface {
	DynamodbData() (map[string]types.AttributeValue, error)
}

DYPayload defines a common interface for data processing

type DYPayloads

type DYPayloads interface {
	Payloads() ([]map[string]types.AttributeValue, error)
}

DYPayloads defines a common interface for batch data processing

type DYQueryAPI

type DYQueryAPI interface {
	Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
}

DYQueryAPI used to prepare unit test

type DYUpdateItemAPI

type DYUpdateItemAPI interface {
	UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
}

type DyPutItemAPI

type DyPutItemAPI interface {
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
}

DyPutItemAPI func

Jump to

Keyboard shortcuts

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