anonymous

package
v5.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalContainerNamesForField

func MarshalContainerNamesForField(
	modelType reflect.Type,
	indexPath []int,
	resolve func(reflect.StructField) (string, bool),
	flatten bool,
) ([]string, bool)

MarshalContainerNamesForField resolves legacy anonymous-container names for a promoted field. Every ancestor container is examined for an exclusion tag even when flat encoding is enabled: flat encoding writes the promoted field directly into the root map, so a skipped container must suppress the field rather than merely omitting the nested container names.

func RequestsFlatEncoding

func RequestsFlatEncoding(value any) bool

RequestsFlatEncoding returns true when the supplied value opts into flat anonymous-embed encoding.

func SetMarshaledAttributeValue

func SetMarshaledAttributeValue(
	root map[string]types.AttributeValue,
	containerNames []string,
	fieldName string,
	av types.AttributeValue,
	flatten bool,
) error

SetMarshaledAttributeValue writes a field AttributeValue either directly into the root map for flat encoding or into the nested legacy anonymous-container path for compatibility encoding.

Types

type FlatEncodingLookup

type FlatEncodingLookup interface {
	FlatAnonymousEmbedEncodingEnabled() bool
}

FlatEncodingLookup reports whether a converter or option carrier requests flat promoted-field encoding for exported anonymous embedded structs.

Jump to

Keyboard shortcuts

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