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

Function serverFromContext

server.go:2047–2050  ·  view source on GitHub ↗

serverFromContext gets the Server from the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2045
2046// serverFromContext gets the Server from the context.
2047func serverFromContext(ctx context.Context) *Server {
2048 s, _ := ctx.Value(serverKey{}).(*Server)
2049 return s
2050}
2051
2052// contextWithServer sets the Server in the context.
2053func contextWithServer(ctx context.Context, server *Server) context.Context {

Callers

nothing calls this directly

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected