fieldcodec

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasJSONModifier

func HasJSONModifier(tag string) bool

HasJSONModifier reports whether a raw theorydb tag includes the json modifier.

func HasJSONTag

func HasJSONTag(tags map[string]string) bool

HasJSONTag reports whether parsed field metadata includes the json modifier.

func HasKeyRoleModifier

func HasKeyRoleModifier(tag, role string) bool

HasKeyRoleModifier reports whether a theorydb tag declares the requested key role either as a standalone token or in the legacy gsi:Name:pk / lsi:Name:sk form. Attribute names containing the same substring do not match.

func HasModifier

func HasModifier(tag, modifier string) bool

HasModifier reports whether a raw comma-separated tag contains an exact standalone modifier token. Substring matches are deliberately rejected because modifiers such as omitempty can control destructive update actions.

func NormalizeJSONFieldValue

func NormalizeJSONFieldValue(fieldType reflect.Type, value any) (any, error)

NormalizeJSONFieldValue converts a json-tagged field value into the canonical Go shape used by DynamoDB conversion. Structured fields are normalized into generic JSON-compatible maps/slices/scalars; string-like fields retain text.

func NormalizeJSONReflectValue

func NormalizeJSONReflectValue(fieldType reflect.Type, value reflect.Value) (any, error)

NormalizeJSONReflectValue mirrors NormalizeJSONFieldValue for reflect-based callers handling struct fields.

func UnmarshalJSONFieldValue

func UnmarshalJSONFieldValue(av types.AttributeValue, dest reflect.Value, fallback func() error) error

UnmarshalJSONFieldValue decodes a json-tagged DynamoDB attribute value into a field destination. Structured fields accept both native document values and legacy JSON strings; string-like fields accept both raw strings and native documents re-encoded as JSON text.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL