kubernetes/test/utils/ktesting/withcontext.go

// WithCancel sets up cancellation in a [TContext.Cleanup] callback and
// constructs a new TContext where [TContext.Cancel] cancels only the new
// context.
func WithCancel(tCtx TContext) TContext {}

// WithTimeout sets up new context with a timeout. Canceling the timeout gets
// registered in a [TContext.Cleanup] callback. [TContext.Cancel] cancels only
// the new context. The cause is used as reason why the context is canceled
// once the timeout is reached. It may be empty, in which case the usual
// "context canceled" error is used.
func WithTimeout(tCtx TContext, timeout time.Duration, timeoutCause string) TContext {}

// WithLogger constructs a new context with a different logger.
func WithLogger(tCtx TContext, logger klog.Logger) TContext {}

type withContext

func (wCtx withContext) Cancel(cause string) {}

func (wCtx withContext) CleanupCtx(cb func(TContext)) {}

func (wCtx withContext) Expect(actual interface{}

func (wCtx withContext) ExpectNoError(err error, explain ...interface{}

func (wCtx withContext) Logger() klog.Logger {}

func (wCtx withContext) Deadline() (time.Time, bool) {}

func (wCtx withContext) Done() <-chan struct{}

func (wCtx withContext) Err() error {}

func (wCtx withContext) Value(key any) any {}