MCPcopy
hub / github.com/grpc/grpc-go / payloadToID

Function payloadToID

stats/stats_test.go:90–95  ·  view source on GitHub ↗
(p *testpb.Payload)

Source from the content-addressed store, hash-verified

88}
89
90func payloadToID(p *testpb.Payload) int32 {
91 if p == nil || len(p.Body) != 4 {
92 panic("invalid payload")
93 }
94 return int32(p.Body[0]) + int32(p.Body[1])<<8 + int32(p.Body[2])<<16 + int32(p.Body[3])<<24
95}
96
97func setIncomingStats(ctx context.Context, mdKey string, b []byte) context.Context {
98 md, ok := metadata.FromIncomingContext(ctx)

Callers 1

newStatsTestStubServerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected