Documentation ¶
Index ¶
- type Codec
- func (codec Codec[T]) Decode(gen map[string]types.AttributeValue) (T, error)
- func (codec Codec[T]) Encode(entity T) (map[string]types.AttributeValue, error)
- func (codec Codec[T]) EncodeKey(key T) (map[string]types.AttributeValue, error)
- func (codec Codec[T]) KeyOnly(gen map[string]types.AttributeValue) map[string]types.AttributeValue
- type Schema
- type Storage
- func (db *Storage[T]) Get(ctx context.Context, key T) (T, error)
- func (db *Storage[T]) Match(ctx context.Context, key T) dynamo.Seq[T]
- func (db *Storage[T]) Put(ctx context.Context, entity T, config ...dynamo.Constraint[T]) error
- func (db *Storage[T]) Remove(ctx context.Context, key T, config ...dynamo.Constraint[T]) error
- func (db *Storage[T]) Update(ctx context.Context, entity T, config ...dynamo.Constraint[T]) (T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
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 Storage ¶
type Storage[T dynamo.Thing] struct { Service dynamo.DynamoDB Table *string Index *string Codec *Codec[T] Schema *Schema[T] // contains filtered or unexported fields }
ddb internal handler for dynamo I/O
Click to show internal directories.
Click to hide internal directories.