MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / createSerializationState

Function createSerializationState

pkg/goproto/struct.go:46–57  ·  view source on GitHub ↗
(opts ...Option)

Source from the content-addressed store, hash-verified

44var errStackDepthExceeded = errors.DefineResourceExhausted("stack_depth_exceeded", "stack depth exceeded")
45
46func createSerializationState(opts ...Option) (*serializationState, error) {
47 serializationState := &serializationState{
48 depth: 1,
49 }
50 for _, opt := range opts {
51 opt(serializationState)
52 }
53 if serializationState.depth > maxNestingDepth {
54 return nil, errStackDepthExceeded.New()
55 }
56 return serializationState, nil
57}
58
59// Map returns the Struct proto as a map[string]interface{}.
60func Map(p *structpb.Struct, opts ...Option) (map[string]any, error) {

Callers 5

MapFunction · 0.85
SliceFunction · 0.85
StructFunction · 0.85
ListFunction · 0.85
valueFromReflectFunction · 0.85

Calls 1

NewMethod · 0.65

Tested by

no test coverage detected