errcontext

package
v3.0.0-beta12 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package errcontext defines a context-aware error handling mechanism using interfaces and a struct that allows sending and receiving a single error.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyCalled = fmt.Errorf("already called")
)

Functions

This section is empty.

Types

type ErrCloseSender

type ErrCloseSender interface {
	ErrCloser
	ErrSender
}

ErrCloseSender embeds ErrCloser and ErrSender interfaces.

type ErrCloser

type ErrCloser interface {
	Close()
}

ErrCloser defines the method to close an error

type ErrContexer

type ErrContexer interface {
	ErrCloser
	ErrReceiver
	ErrSender
}

ErrContexer embeds ErrReceiver, ErrSender and ErrCloser interfaces.

func New

func New(ctx context.Context) ErrContexer

New creates ErrContexer with an error channel and context. When used ctx is nil, background context is used => Receive() calls are blocking until Send call or Close call.

type ErrReceiver

type ErrReceiver interface {
	Receive() error
}

ErrReceiver defines the method to receive an error.

type ErrSender

type ErrSender interface {
	Send(error)
}

ErrSender defines the method to send an error.

Jump to

Keyboard shortcuts

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