MCPcopy Create free account
hub / github.com/apache/fory / newStructSerializer

Function newStructSerializer

go/fory/struct.go:72–81  ·  view source on GitHub ↗

newStructSerializer creates a new structSerializer with the given parameters. name can be empty and will be derived from type_.Name() if not provided. fieldDefs can be nil for local structs without remote schema.

(type_ reflect.Type, name string)

Source from the content-addressed store, hash-verified

70// name can be empty and will be derived from type_.Name() if not provided.
71// fieldDefs can be nil for local structs without remote schema.
72func newStructSerializer(type_ reflect.Type, name string) *structSerializer {
73 if name == "" && type_ != nil {
74 name = type_.Name()
75 }
76 return &structSerializer{
77 type_: type_,
78 name: name,
79 userTypeID: invalidUserTypeID,
80 }
81}
82
83func (s *structSerializer) Write(ctx *WriteContext, refMode RefMode, writeType bool, hasGenerics bool, value reflect.Value) {
84 switch refMode {

Callers 3

RegisterStructMethod · 0.85
registerStructByNameMethod · 0.85
GetStructHashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected