Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormatFieldTag ¶
type FormatFieldTag struct {
Name string
HasNameOrCase bool
OmitEmpty bool
Ignore bool
Inline bool
Nullable bool
TimeLayout string
}
FormatFieldTag captures effective per-field format-tag attributes compiled into runtime plans.
func ParseFormatFieldTag ¶
func ParseFormatFieldTag(sf reflect.StructField, baseName string) FormatFieldTag
ParseFormatFieldTag parses struct-level `format` tag attributes used by the JSON runtime.
type JSONTag ¶
func ParseJSONTag ¶
type ResolvedFieldTag ¶
type ResolvedFieldTag struct {
Name string
Explicit bool
OmitEmpty bool
Ignore bool
Inline bool
Format FormatFieldTag
}
func ResolveFieldTag ¶
func ResolveFieldTag(sf reflect.StructField) ResolvedFieldTag
ResolveFieldTag resolves precedence among json, jsonx and format tags. Precedence: 1) json explicit non-empty name/transient wins over format name/case. 2) inline is enabled by anonymous or jsonx:inline or format:inline. 3) ignore is enabled by json:"-" or internal:true or format:ignore. 4) omitempty is enabled by json omitempty OR format omitempty.
Click to show internal directories.
Click to hide internal directories.