MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / RPCMethod

Function RPCMethod

runtime/context.go:375–385  ·  view source on GitHub ↗

RPCMethod returns the method string for the server context. The returned string is in the format of "/package.service/method".

(ctx context.Context)

Source from the content-addressed store, hash-verified

373// RPCMethod returns the method string for the server context. The returned
374// string is in the format of "/package.service/method".
375func RPCMethod(ctx context.Context) (string, bool) {
376 m := ctx.Value(rpcMethodKey{})
377 if m == nil {
378 return "", false
379 }
380 ms, ok := m.(string)
381 if !ok {
382 return "", false
383 }
384 return ms, true
385}
386
387func withRPCMethod(ctx context.Context, rpcMethodName string) context.Context {
388 return context.WithValue(ctx, rpcMethodKey{}, rpcMethodName)

Calls

no outgoing calls