Documentation
¶
Overview ¶
Package types provides type conversion between Go types and DynamoDB AttributeValues
Index ¶
- type Converter
- func (c *Converter) ConvertToSet(slice any, isSet bool) (types.AttributeValue, error)
- func (c *Converter) FromAttributeValue(av types.AttributeValue, target any) error
- func (c *Converter) HasCustomConverter(typ reflect.Type) bool
- func (c *Converter) RegisterConverter(typ reflect.Type, converter CustomConverter)
- func (c *Converter) ToAttributeValue(value any) (types.AttributeValue, error)
- type CustomConverter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter handles conversion between Go types and DynamoDB AttributeValues
func (*Converter) ConvertToSet ¶
ConvertToSet determines if a slice should be converted to a DynamoDB set
func (*Converter) FromAttributeValue ¶
func (c *Converter) FromAttributeValue(av types.AttributeValue, target any) error
FromAttributeValue converts a DynamoDB AttributeValue to Go value
func (*Converter) HasCustomConverter ¶ added in v1.0.30
HasCustomConverter returns true if a custom converter exists for the given type.
func (*Converter) RegisterConverter ¶
func (c *Converter) RegisterConverter(typ reflect.Type, converter CustomConverter)
RegisterConverter registers a custom converter for a specific type
func (*Converter) ToAttributeValue ¶
func (c *Converter) ToAttributeValue(value any) (types.AttributeValue, error)
ToAttributeValue converts a Go value to DynamoDB AttributeValue
type CustomConverter ¶
type CustomConverter interface {
// ToAttributeValue converts a Go value to DynamoDB AttributeValue
ToAttributeValue(value any) (types.AttributeValue, error)
// FromAttributeValue converts a DynamoDB AttributeValue to Go value
FromAttributeValue(av types.AttributeValue, target any) error
}
CustomConverter defines the interface for custom type converters
Click to show internal directories.
Click to hide internal directories.