errbus

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 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 Bus

type Bus struct {
	// contains filtered or unexported fields
}

Bus is an error bus that can be used to provide an async error API.

func New

func New() *Bus

New returns a new Bus.

func (*Bus) Publish

func (b *Bus) Publish(ctx context.Context, err error) error

Publish publishes the error to all subscribers.

func (*Bus) Subscribe

func (b *Bus) Subscribe(ctx context.Context) <-chan error

Subscribe returns a channel of errors. When an error is published through b.Publish, that error will be received from the error channel.

Jump to

Keyboard shortcuts

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