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

Function GetStructHash

go/fory/struct_init.go:31–37  ·  view source on GitHub ↗

GetStructHash returns the struct hash for a given type using the provided TypeResolver. This is used by codegen serializers to get the hash at runtime.

(type_ reflect.Type, resolver *TypeResolver)

Source from the content-addressed store, hash-verified

29// GetStructHash returns the struct hash for a given type using the provided TypeResolver.
30// This is used by codegen serializers to get the hash at runtime.
31func GetStructHash(type_ reflect.Type, resolver *TypeResolver) int32 {
32 ser := newStructSerializer(type_, "")
33 if err := ser.initialize(resolver); err != nil {
34 panic(fmt.Errorf("failed to initialize struct serializer for hash computation: %v", err))
35 }
36 return ser.structHash
37}
38
39// initialize performs eager initialization of the struct serializer.
40// This should be called at registration time to pre-compute all field metadata.

Callers

nothing calls this directly

Calls 2

newStructSerializerFunction · 0.85
initializeMethod · 0.45

Tested by

no test coverage detected