Documentation
¶
Overview ¶
Package dynamox contains DynamoDB utilities.
Index ¶
- func AttrAs[T types.AttributeValue](item map[string]types.AttributeValue, name string) (v T, err error)
- func DeleteTableIfNotExists(ctx context.Context, client *dynamodb.Client, table string) error
- func NewTestClient(t testing.TB) *dynamodb.Client
- func Range(ctx context.Context, client *dynamodb.Client, ...) error
- func TryAttrAs[T types.AttributeValue](item map[string]types.AttributeValue, name string) (v T, ok bool, err error)
- type RangeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttrAs ¶
func AttrAs[T types.AttributeValue]( item map[string]types.AttributeValue, name string, ) (v T, err error)
AttrAs fetches an attribute of type T from an item.
It returns an error if the item is absent or a different type.
func DeleteTableIfNotExists ¶
DeleteTableIfNotExists deletes a DynamoDB table if it does not exist.
func NewTestClient ¶
NewTestClient returns a new DynamoDB client for use in a test.
func Range ¶ added in v0.9.1
func Range( ctx context.Context, client *dynamodb.Client, m func(any) []func(*dynamodb.Options), in *dynamodb.QueryInput, fn RangeFunc, ) error
Range executes a query and calls fn for each item in the result set.
func TryAttrAs ¶ added in v0.9.0
func TryAttrAs[T types.AttributeValue]( item map[string]types.AttributeValue, name string, ) (v T, ok bool, err error)
TryAttrAs fetches an attribute of type T from an item.
It returns an error if the item is a different type.
Types ¶
Click to show internal directories.
Click to hide internal directories.