Documentation
¶
Overview ¶
Package contextutil provides utilities for working with the Go context package.
Index ¶
- func GetBackoffCoefficient(ctx context.Context) float64
- func GetBackoffExponentialMaxInterval(ctx context.Context) time.Duration
- func GetBackoffPolicy(ctx context.Context) string
- func GetInterval(ctx context.Context) time.Duration
- func GetInvertCheck(ctx context.Context) bool
- func GetTimeout(ctx context.Context) time.Duration
- func WithBackoffCoefficient(ctx context.Context, backoffCoefficient float64) context.Context
- func WithBackoffExponentialMaxInterval(ctx context.Context, backoffExponentialMaxInterval time.Duration) context.Context
- func WithBackoffPolicy(ctx context.Context, backoffPolicy string) context.Context
- func WithInterval(ctx context.Context, interval time.Duration) context.Context
- func WithInvertCheck(ctx context.Context, invertCheck bool) context.Context
- func WithTimeout(ctx context.Context, timeout time.Duration) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBackoffCoefficient ¶
GetBackoffCoefficient retrieves the backoff coefficient from the given context.
func GetBackoffExponentialMaxInterval ¶
GetBackoffExponentialMaxInterval retrieves the backoff exponential max interval from the given context.
func GetBackoffPolicy ¶
GetBackoffPolicy retrieves the backoff policy from the given context.
func GetInterval ¶
GetInterval retrieves interval from context
func GetInvertCheck ¶
GetInvertCheck retrieves invert-check from context
func GetTimeout ¶
GetTimeout retrieves timeout from context
func WithBackoffCoefficient ¶
WithBackoffCoefficient returns a new context with the given backoff coefficient value.
func WithBackoffExponentialMaxInterval ¶
func WithBackoffExponentialMaxInterval(ctx context.Context, backoffExponentialMaxInterval time.Duration) context.Context
WithBackoffExponentialMaxInterval returns a new context with the given backoff exponential max interval value.
func WithBackoffPolicy ¶
WithBackoffPolicy returns a new context with the given backoff policy value.
func WithInterval ¶
WithInterval returns a new context with the given interval value.
func WithInvertCheck ¶
WithInvertCheck returns a new context with the given invert-check value.
Types ¶
This section is empty.