errctx

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package errctx provides implementations of context.Context that allow for cancellation or deadline expiration with custom error messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCancel

func WithCancel(parent context.Context) (context.Context, func(error))

WithCancel returns a child context with a cancellation function that accepts custom errors.

func WithDeadline

func WithDeadline(parent context.Context, deadline time.Time, err error) (context.Context, func(error))

WithDeadline returns a child context that expires with a custom error after the supplied deadline, and a cancellation function that accepts custom errors.

func WithTimeout

func WithTimeout(parent context.Context, duration time.Duration, err error) (context.Context, func(error))

WithTimeout returns a child context that expires with a custom error after the duration expires, and a cancellation function that accepts custom errors.

Types

This section is empty.

Jump to

Keyboard shortcuts

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