Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Decode = generic.DefineFunc("Decode(dst interface{}, src interface{})").
Param("EXT", "user provided extension").
Param("DT", "the dst type to copy into").
Param("ST", "the src type to copy from").
ImportPackage("reflect").
Declare("var typeOf = reflect.TypeOf").
ImportFunc(decodeAnything).
Source(`
{{ $decode := expand "DecodeAnything" "EXT" .EXT "DT" .DT "ST" .ST }}
iter := src.({{.ST|name}})
{{ range $extType := .EXT.ExtTypes }}
if iter.GetDecoder("{{$extType|name}}") == nil {
iter.PrepareDecoder(reflect.TypeOf((*{{$extType|name}})(nil)).Elem())
}
{{ end }}
{{$decode}}(dst.({{.DT|name}}), iter)
`)
View Source
var Encode = generic.DefineFunc("Encode(dst interface{}, src interface{})").
Param("EXT", "user provided extension").
Param("DT", "the dst type to copy into").
Param("ST", "the src type to copy from").
ImportFunc(encodeAnything).
ImportPackage("reflect").
Declare("var typeOf = reflect.TypeOf").
Source(`
{{ $decode := expand "EncodeAnything" "EXT" .EXT "DT" .DT "ST" .ST }}
stream := dst.({{.DT|name}})
{{ range $extType := .EXT.ExtTypes }}
if stream.GetEncoder("{{$extType|name}}") == nil {
stream.PrepareEncoder(reflect.TypeOf((*{{$extType|name}})(nil)).Elem())
}
{{ end }}
{{$decode}}(stream, src.({{.ST|name}}))
`)
Functions ¶
This section is empty.
Types ¶
Source Files
¶
- binding.go
- codegen.go
- decode.go
- decode_anything.go
- decode_binary.go
- decode_enum.go
- decode_map.go
- decode_pointer.go
- decode_simple_value.go
- decode_slice.go
- decode_struct.go
- encode.go
- encode_anything.go
- encode_binary.go
- encode_enum.go
- encode_map.go
- encode_pointer.go
- encode_simple_value.go
- encode_slice.go
- encode_struct.go
Click to show internal directories.
Click to hide internal directories.