Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckContext ¶
CheckContext checks if a go context is still active or done When it's done, returns a generic error
func myFunc(ctx context.Context) error { if err := common.CheckContext(ctx); err != nil { return err } else { doSomething() } }
func New ¶ added in v0.9.0
New creates a new golang context with the provided options. If a parent context is provided, creates a copy of the parent with further options. If a timeout option is provided, creates a context that cancels itself automatically after the timeout.
func WithParent ¶ added in v0.9.0
WithParent returns an option to create a new context based on an existing parent context.
func WithTimeout ¶ added in v0.9.0
WithTimeout return an option to create a new context that cancels itself automatically after the timeout.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.