MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / NewContextWithFetcher

Function NewContextWithFetcher

pkg/auth/rights/fetcher.go:107–109  ·  view source on GitHub ↗

NewContextWithFetcher returns a new context with the given rights fetcher.

(ctx context.Context, fetcher Fetcher)

Source from the content-addressed store, hash-verified

105
106// NewContextWithFetcher returns a new context with the given rights fetcher.
107func NewContextWithFetcher(ctx context.Context, fetcher Fetcher) context.Context {
108 return context.WithValue(ctx, fetcherKey, fetcher)
109}
110
111func fetcherFromContext(ctx context.Context) (Fetcher, bool) {
112 if fetcher, ok := ctx.Value(fetcherKey).(Fetcher); ok {

Callers 8

TestRequireFunction · 0.92
initRightsMethod · 0.92
TestServerFunction · 0.92
TestGetGatewayFunction · 0.92
NewFunction · 0.92
TestContextParentFunction · 0.92

Calls

no outgoing calls

Tested by 6

TestRequireFunction · 0.74
TestServerFunction · 0.74
TestGetGatewayFunction · 0.74
TestContextParentFunction · 0.74