ctxutil

package
v1.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ctxutil provides utilities for working with contexts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause

func Cause(ctx context.Context) error

Cause returns the cause of the context error, or nil if there is no error or the error is a usual context error.

func MonitorFn

func MonitorFn(ctx context.Context, fn func() error) context.Context

MonitorFn starts a function in a new goroutine and cancels the context with error as cause when the function returns. It returns the new context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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