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