context

package
v0.0.0-...-dd0f3b3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advice

type Advice interface {
	// contains filtered or unexported methods
}

type Context

type Context[In, Out any] struct {
	Done    <-chan Done
	Monitor chan<- Advice
	In      <-chan In
	Out     chan<- Out
}

func Make

func Make[In, Out any](
	done <-chan Done,
	monitor chan<- Advice,
	in <-chan In,
	out chan<- Out,
) *Context[In, Out]

func With

func With[OldIn, OldOut, In, Out any](
	c *Context[OldIn, OldOut], in chan In, out chan Out,
) *Context[In, Out]

func WithIn

func WithIn[OldIn, Out, In any](
	c *Context[OldIn, Out], in chan In,
) *Context[In, Out]

func WithOut

func WithOut[In, OldOut, Out any](
	c *Context[In, OldOut], out chan Out,
) *Context[In, Out]

func (*Context[In, Out]) Advise

func (c *Context[In, Out]) Advise(a Advice) bool

func (*Context[_, _]) Debugf

func (c *Context[_, _]) Debugf(format string, v ...any) bool

func (*Context[_, _]) Error

func (c *Context[_, _]) Error(err error) bool

func (*Context[_, _]) Errorf

func (c *Context[_, _]) Errorf(format string, v ...any) bool

func (*Context[_, _]) Fatal

func (c *Context[_, _]) Fatal(err error) bool

func (*Context[_, _]) Fatalf

func (c *Context[_, _]) Fatalf(format string, v ...any) bool

func (*Context[In, Out]) FetchMessage

func (c *Context[In, Out]) FetchMessage() (In, bool)

func (*Context[In, Out]) ForwardResult

func (c *Context[In, Out]) ForwardResult(res Out) bool

func (*Context[In, Out]) IsDone

func (c *Context[In, Out]) IsDone() bool

type Debug

type Debug struct {
	Message string
	Stack   []byte
}

type Done

type Done struct{}

type Error

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

Error is Advice that reports a recoverable error to the Stream.

type Fatal

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

Fatal is Advice that reports a non-recoverable error to the Stream. The Stream will be stopped when encountering such an error.

type Stop

type Stop struct{}

Stop is Advice that instructs the Stream to completely stop operating. This should only be used in exceptional cases.

Jump to

Keyboard shortcuts

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