package serde
import "github.com/aws/smithy-go/document/internal/serde"
Index ¶
- Variables
- func DecoderFieldByIndex(v reflect.Value, index []int) reflect.Value
- func EncoderFieldByIndex(v reflect.Value, index []int) (reflect.Value, bool)
- func Indirect(v reflect.Value, decodingNull bool) reflect.Value
- func IsZeroValue(v reflect.Value) bool
- func PtrToValue(in interface{}) interface{}
- func ValueElem(v reflect.Value) reflect.Value
- type CachedFields
- func GetStructFields(t reflect.Type) *CachedFields
- func (f *CachedFields) All() []Field
- func (f *CachedFields) FieldByName(name string) (Field, bool)
- type Field
- type Tag
Variables ¶
var ReflectTypeOf = struct { BigFloat reflect.Type BigInt reflect.Type DocumentNumber reflect.Type MapStringToInterface reflect.Type Time reflect.Type }{ BigFloat: reflect.TypeOf((*big.Float)(nil)).Elem(), BigInt: reflect.TypeOf((*big.Int)(nil)).Elem(), DocumentNumber: reflect.TypeOf((*document.Number)(nil)).Elem(), MapStringToInterface: reflect.TypeOf((map[string]interface{})(nil)), Time: reflect.TypeOf((*time.Time)(nil)).Elem(), }
ReflectTypeOf is a structure containing various reflect.Type members that are useful to document Marshaler or Unmarshaler implementations.
Functions ¶
func DecoderFieldByIndex ¶
DecoderFieldByIndex finds the field with the provided nested index, allocating embedded parent structs if needed
func EncoderFieldByIndex ¶
EncoderFieldByIndex finds the field with the provided nested index
func Indirect ¶
Indirect will walk a value's interface or pointer value types. Returning the final value or the value a unmarshaler is defined on.
Based on the enoding/json type reflect value type indirection in Go Stdlib https://golang.org/src/encoding/json/decode.go Indirect func.
func IsZeroValue ¶
IsZeroValue returns whether v is the zero-value for its type.
func PtrToValue ¶
func PtrToValue(in interface{}) interface{}
PtrToValue given the input value will dereference pointers and returning the element pointed to.
func ValueElem ¶
ValueElem walks interface and pointer types and returns the underlying element.
Types ¶
type CachedFields ¶
type CachedFields struct {
// contains filtered or unexported fields
}
CachedFields is a cache entry for a type's fields.
func GetStructFields ¶
func GetStructFields(t reflect.Type) *CachedFields
GetStructFields returns a list of fields for the given type. Type info is cached to avoid repeated calls into the reflect package
func (*CachedFields) All ¶
func (f *CachedFields) All() []Field
All returns all the fields for the cached type.
func (*CachedFields) FieldByName ¶
func (f *CachedFields) FieldByName(name string) (Field, bool)
FieldByName retrieves a field by name.
type Field ¶
Field is represents a struct field, tag, type, and index.
type Tag ¶
Tag represents the `document` struct field tag and associated options
func ParseTag ¶
ParseTag splits a struct field tag into its name and comma-separated options.
Source Files ¶
field.go field_cache.go reflect.go serde.go tags.go
- Version
- v1.22.3 (latest)
- Published
- Feb 17, 2025
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 3 weeks ago –
Tools for package owners.