AddConfig returns a mutable config structure based on a shallow copy of that found in ctx and returns a new context with that added to it.
(ctx context.Context)
| 705 | // copy of that found in ctx and returns a new context with that added |
| 706 | // to it. |
| 707 | func AddConfig(ctx context.Context) (context.Context, *Filter) { |
| 708 | c := GetConfig(ctx) |
| 709 | cCopy := new(Filter) |
| 710 | *cCopy = *c |
| 711 | newCtx := context.WithValue(ctx, configContextKey, cCopy) |
| 712 | return newCtx, cCopy |
| 713 | } |
| 714 | |
| 715 | // ReplaceConfig replaces the filter config in the ctx with the one |
| 716 | // passed in and returns a new context with that added to it. |
searching dependent graphs…