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 TryAttrAs[T types.AttributeValue](item map[string]types.AttributeValue, name string) (v T, ok bool, err error)
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 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 ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.