Documentation ¶
Overview ¶
Package ctxutil provides convenience functions for working with context.Context objects.
Index ¶
Constants ¶
const MaxTimeout time.Duration = math.MaxInt64
MaxTimeout is the maximum value of time.Duration, approximately 290 years.
This value might be useful on calling some timeout-related functions. For example, context.WithTimeout(ctx, ctxutil.MaxTimeout) returns a new context with effectively the same deadline as the original context. (Precisely, if the original context has no deadline or a deadline later than MaxDuration, the new deadline is different, but it is so future that we do not need to distinguish them.)
Variables ¶
This section is empty.
Functions ¶
func DeadlineBefore ¶
DeadlineBefore returns true if ctx has a deadline that expires before t. It returns true if the deadline has already expired and false if no deadline is set.
Types ¶
This section is empty.