dynamodb

package
v0.0.0-...-aae8ef2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTableExists = errors.New("table exists")
	ErrNoTable     = errors.New("table does not exist")
	ErrNoClient    = errors.New("no DDB client")
)

Functions

func New

func New(config aws.Config) (*db, error)

Types

type Attribute

type Attribute struct {
	Name string
	Type types.ScalarAttributeType
}

type DB

type DB interface {
	Client() *dynamodb.Client
	Table(name string) Table
}

type Key

type Key struct {
	Name string
	Type types.KeyType
}

type Page

type Page interface {
	Count() int
	ForEach(func(map[string]types.AttributeValue) error) error
}

type Paginator

type Paginator interface {
	Pages(func([]map[string]types.AttributeValue) error) error
	ForEach(func(map[string]types.AttributeValue) error) error
}

func NewPaginator

func NewPaginator(client *dynamodb.Client, in any) (pg Paginator, err error)

type Table

type Table interface {
	Name() string
	Exists() bool
	Create() error
	Db() DB
	Describe() (*types.TableDescription, error)
	WithKeys(keys ...Key) Table
	WithAttributes(attr ...Attribute) Table
	WithThroughput(r, w int64) Table
}

Jump to

Keyboard shortcuts

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