ddb

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[T dynamo.Thing](io *session.Session, spec *common.URL) dynamo.KeyVal[T]

Types

type Codec

type Codec[T dynamo.Thing] struct {
	// contains filtered or unexported fields
}

Codec is utility to encode/decode objects to dynamo representation

func (Codec[T]) Decode

func (codec Codec[T]) Decode(gen map[string]*dynamodb.AttributeValue) (*T, error)

Decode dynamo representation to object

func (Codec[T]) Encode

func (codec Codec[T]) Encode(entity T) (map[string]*dynamodb.AttributeValue, error)

Encode object to dynamo representation

func (Codec[T]) EncodeKey

func (codec Codec[T]) EncodeKey(key T) (map[string]*dynamodb.AttributeValue, error)

EncodeKey to dynamo representation

func (Codec[T]) KeyOnly

func (codec Codec[T]) KeyOnly(gen map[string]*dynamodb.AttributeValue) map[string]*dynamodb.AttributeValue

KeyOnly extracts key value from generic representation

type Schema

type Schema[T dynamo.Thing] struct {
	ExpectedAttributeNames map[string]*string
	Projection             *string
}

Schema is utility that decodes type into projection expression

func NewSchema

func NewSchema[T dynamo.Thing]() *Schema[T]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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