dynamodb

package
v0.0.0-...-6e646ca Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxDynamoRetries  = 3
	MaxBatchGetSize   = 100
	MaxBatchWriteSize = 25
)

Functions

func MarshallIds

func MarshallIds(idKey string, ids []*string) []map[string]*dynamodb.AttributeValue

func TableExists

func TableExists(tableName *string, client Client) bool

Types

type Client

type Client interface {
	PutItemInTable(cc call.Call, tableName string, item interface{}, retriesLeft int) (err error)
	UpdateItemInTable(cc call.Call, tableName, keyName, keyValue, updateExpression, conditionalExpression string, attributeNames map[string]*string, key, attributeValues map[string]*dynamodb.AttributeValue, retriesLeft int) (err error)
	GetItemFromTable(cc call.Call, tableName, keyName, keyValue string, key map[string]*dynamodb.AttributeValue, resultInterface interface{}, retriesLeft int) (err error)
}

type Service

type Service struct {
	Client
	Svc dynamodbiface.DynamoDBAPI
}

func InitDynamo

func InitDynamo(cc call.Call) *Service

func (*Service) GetItemFromTable

func (s *Service) GetItemFromTable(
	cc call.Call,
	tableName, keyName, keyValue string,
	key map[string]*dynamodb.AttributeValue,
	resultInterface interface{},
	retriesLeft int,
) (err error)

GetItemFromTable handles adding an item to dynamo

func (*Service) PutItemInTable

func (s *Service) PutItemInTable(cc call.Call, tableName string, item interface{}, retriesLeft int) (err error)

PutItemInTable handles adding an item to dynamo

func (*Service) UpdateItemInTable

func (s *Service) UpdateItemInTable(
	cc call.Call,
	tableName, keyName, keyValue, updateExpression, conditionalExpression string,
	attributeNames map[string]*string,
	key, attributeValues map[string]*dynamodb.AttributeValue,
	retriesLeft int,
) (err error)

UpdateItemInTable handles adding an item to dynamo

Jump to

Keyboard shortcuts

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