ddbhelper

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

ddbhelper

Go Reference License

This project is a helper library for working with DynamoDB in Go. It is not a full-fledged ORM, but rather a set of utilities to make working with DynamoDB easier. It is intended to be used in conjunction with the AWS SDK for Go v2.

Installation

go get github.com/kpes/ddbhelper

Usage

See example/main.go for a full example.

Contributing

TBD

License

Apache License 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityHandler added in v0.1.0

type EntityHandler[T Record] struct {
	TableDef  TableDefinition
	DdbClient ddbClient
}

func (EntityHandler[T]) Delete added in v0.1.0

func (s EntityHandler[T]) Delete(ctx context.Context, t T) error

func (EntityHandler[T]) Get added in v0.1.0

func (s EntityHandler[T]) Get(ctx context.Context, t T) (*T, error)

func (EntityHandler[T]) Insert added in v0.1.0

func (s EntityHandler[T]) Insert(ctx context.Context, t T) error

func (EntityHandler[T]) Update added in v0.1.0

func (s EntityHandler[T]) Update(ctx context.Context, t T, attributes map[string]interface{}) error

type Index added in v0.1.0

type Index struct {
	PartitionKeyAttribute string
	SortKeyAttribute      string
}

type Record added in v0.1.0

type Record interface {
	PartitionKey() string
	SortKey() string
}

type TableDefinition added in v0.1.0

type TableDefinition struct {
	TableName        string
	TableIndex       Index
	SecondaryIndexes map[string]Index
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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