NewContextWithHashValidator returns a context derived from parent that contains hashValidator.
(parent context.Context, hashValidator HashValidator)
| 45 | |
| 46 | // NewContextWithHashValidator returns a context derived from parent that contains hashValidator. |
| 47 | func NewContextWithHashValidator(parent context.Context, hashValidator HashValidator) context.Context { |
| 48 | return context.WithValue(parent, hashValidatorContextKey, hashValidator) |
| 49 | } |
| 50 | |
| 51 | // HashValidatorFromContext returns the HashValidator from the context if present. Otherwise it returns default HashValidator. |
| 52 | func HashValidatorFromContext(ctx context.Context) HashValidator { |
no outgoing calls