MCPcopy Create free account
hub / github.com/pace/bricks / ContextWithExternalDependency

Function ContextWithExternalDependency

http/middleware/external_dependency.go:71–73  ·  view source on GitHub ↗

ContextWithExternalDependency creates a contex with the external provided dependencies

(ctx context.Context, edc *ExternalDependencyContext)

Source from the content-addressed store, hash-verified

69
70// ContextWithExternalDependency creates a contex with the external provided dependencies
71func ContextWithExternalDependency(ctx context.Context, edc *ExternalDependencyContext) context.Context {
72 return context.WithValue(ctx, (*ExternalDependencyContext)(nil), edc)
73}
74
75// ExternalDependencyContextFromContext returns the external dependencies context or nil
76func ExternalDependencyContextFromContext(ctx context.Context) *ExternalDependencyContext {

Calls 1

WithValueMethod · 0.80

Used in the wild real call sites across dependent graphs

searching dependent graphs…