dynamo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindTable

func BindTable(table ITable)

func Client

func Client() *dynamodb.Client

func ConnAWS

func ConnAWS(region string) *util.Err

func ConnLocal

func ConnLocal(url string) *util.Err

func CreateTable

func CreateTable(tableName string) *util.Err

func GetEntity

func GetEntity[T any](table string, filter util.M, consistent bool, entity T, projectAttrs ...string) *util.Err

func IsTableExist

func IsTableExist(table string) (bool, *util.Err)

func MigrateTables

func MigrateTables()

func PutNewEntity

func PutNewEntity(table string, entity util.M, unique ...string) *util.Err

func PutOrReplaceEntity

func PutOrReplaceEntity(table string, entity any) *util.Err

func QueryEntities

func QueryEntities[T any](table string, filter util.M, items *[]T, projectAttrs ...string) *util.Err

func QueryEntitiesBetween

func QueryEntitiesBetween[T any](table, key string, start, end any, limit int32,
	forward bool, items *[]T, projectAttrs ...string) *util.Err

func UpdateEntity

func UpdateEntity(table string, filter, data util.M) *util.Err

func UpdateEntityWithResult

func UpdateEntityWithResult(table string, filter, data util.M, resultValue types.ReturnValue, result UpdateResult) *util.Err

Types

type ITable

type ITable interface {
	Name() string
	AttributeDefinitions() []types.AttributeDefinition
	KeySchema() []types.KeySchemaElement
}

func NewTable

func NewTable(name, hashKey, rangeKey string, attrs map[string]types.ScalarAttributeType) ITable

type MAV

type MAV map[string]types.AttributeValue

type UpdateResult

type UpdateResult map[string]map[string]any

Jump to

Keyboard shortcuts

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