ddb

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[T dynamo.Thing](cfg *dynamo.Config) 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]types.AttributeValue) (T, error)

Decode dynamo representation to object

func (Codec[T]) Encode

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

Encode object to dynamo representation

func (Codec[T]) EncodeKey

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

EncodeKey to dynamo representation

func (Codec[T]) KeyOnly

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

KeyOnly extracts key value from generic representation

type DynamoDB added in v1.6.0

DynamoDB declares API used by the library

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