contextutil

package
v3.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package contextutil provides utilities for working with the Go context package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBackoffCoefficient

func GetBackoffCoefficient(ctx context.Context) float64

GetBackoffCoefficient retrieves the backoff coefficient from the given context.

func GetBackoffExponentialMaxInterval

func GetBackoffExponentialMaxInterval(ctx context.Context) time.Duration

GetBackoffExponentialMaxInterval retrieves the backoff exponential max interval from the given context.

func GetBackoffPolicy

func GetBackoffPolicy(ctx context.Context) string

GetBackoffPolicy retrieves the backoff policy from the given context.

func GetInterval

func GetInterval(ctx context.Context) time.Duration

GetInterval retrieves interval from context

func GetInvertCheck

func GetInvertCheck(ctx context.Context) bool

GetInvertCheck retrieves invert-check from context

func GetTimeout

func GetTimeout(ctx context.Context) time.Duration

GetTimeout retrieves timeout from context

func WithBackoffCoefficient

func WithBackoffCoefficient(ctx context.Context, backoffCoefficient float64) context.Context

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

func WithBackoffPolicy(ctx context.Context, backoffPolicy string) context.Context

WithBackoffPolicy returns a new context with the given backoff policy value.

func WithInterval

func WithInterval(ctx context.Context, interval time.Duration) context.Context

WithInterval returns a new context with the given interval value.

func WithInvertCheck

func WithInvertCheck(ctx context.Context, invertCheck bool) context.Context

WithInvertCheck returns a new context with the given invert-check value.

func WithTimeout

func WithTimeout(ctx context.Context, timeout time.Duration) context.Context

WithTimeout returns a new context with the given timeout value.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL