Configure struct tags for DynamoDB mapping
masterDynamo uses the dynamo struct tag to map Go fields to DynamoDB attributes. The format is dynamo:"attributeName,option1,option2".
Common Options:
- Renaming:
dynamo:"other_name"changes the attribute name. - Omission:
dynamo:"-"ignores the field. Fields starting with lowercase letters are also ignored. - Sets:
dynamo:",set"marshals slices or maps as DynamoDB sets. Supported types:[]T,map[T]struct{}, andmap[T]bool. - omitempty:
dynamo:",omitempty"omits the field if it has a zero value. Supports theisZeroerinterface (IsZero() bool). - omitemptyelem:
dynamo:",omitemptyelem"omits empty values inside slices. - allowempty:
dynamo:",allowempty"overrides automatic omission of empty strings, sets, or structs. - null:
dynamo:",null"forces empty/nil values to marshal as the DynamoDB NULL type. - unixtime:
dynamo:",unixtime"marshalstime.Timeas a Unix timestamp (useful for TTL).