contextcause

package
v1.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelErrFunc

type CancelErrFunc func(err error)

CancelErrFunc cancels a context simular to context.CancelFunc. However it indicates why the context was canceled with the provided error.

func WithCancelCause

func WithCancelCause(parent context.Context) (context.Context, CancelErrFunc)

WithCancelCause returns a copy of parent with a new Done channel. The returned context's Done channel is closed when the returned cancel function is called or when the parent context's Done channel is closed, whichever happens first. Unlike the conext package's WithCancel, the cancel func takes an error, and will return that error on subsequent calls to Err().

Jump to

Keyboard shortcuts

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