package context
import "github.com/aws/smithy-go/context"
Index ¶
- func GetPreserveExpiredValues(ctx context.Context) bool
- func WithPreserveExpiredValues(ctx context.Context, enable bool) context.Context
- func WithSuppressCancel(ctx context.Context) context.Context
Functions ¶
func GetPreserveExpiredValues ¶
GetPreserveExpiredValues looks up, and returns the PreserveExpressValues value in the context. Returning true if enabled, false otherwise.
func WithPreserveExpiredValues ¶
WithPreserveExpiredValues adds a Value to the Context if expired values should be preserved, and looked up by a Context wrapped by WithSuppressCancel.
WithPreserveExpiredValues must be added as a value to a Context, before that Context is wrapped by WithSuppressCancel
func WithSuppressCancel ¶
WithSuppressCancel wraps the Context value, suppressing its deadline and cancellation events being propagated downstream to consumer of the returned context.
By default the wrapped Context's Values are available downstream until the wrapped Context is canceled. Once the wrapped Context is canceled, Values method called on the context return will no longer lookup any key. As they are now considered expired.
To override this behavior, use WithPreserveExpiredValues on the Context before it is wrapped by WithSuppressCancel. This will make the Context returned by WithSuppressCancel allow lookup of expired values.
Source Files ¶
- Version
- v1.22.3 (latest)
- Published
- Feb 17, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 3 weeks ago –
Tools for package owners.