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

Function getRPCBehaviorMetadata

interop/xds/server/server.go:180–195  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

178}
179
180func getRPCBehaviorMetadata(ctx context.Context) []string {
181 mdRPCBehavior := getMetadataValues(ctx, rpcBehaviorMDKey)
182 var rpcBehaviorMetadata []string
183 for _, mdVal := range mdRPCBehavior {
184 splitVals := strings.Split(mdVal, ",")
185
186 for _, val := range splitVals {
187 headerVal := strings.TrimSpace(val)
188 if headerVal == "" {
189 continue
190 }
191 rpcBehaviorMetadata = append(rpcBehaviorMetadata, headerVal)
192 }
193 }
194 return rpcBehaviorMetadata
195}
196
197func getMetadataValues(ctx context.Context, metadataKey string) []string {
198 md, ok := metadata.FromIncomingContext(ctx)

Callers 1

UnaryCallMethod · 0.85

Calls 1

getMetadataValuesFunction · 0.85

Tested by

no test coverage detected