Documentation
¶
Index ¶
- Variables
- func BadRequest(err error) error
- func BadRequestWrapf(format string, args ...any) error
- func BadRequestf(format string, args ...any) error
- func CancelWithNotImplemented(ctx interfaces.ActiveContext)
- func ContextCancelWith499ClientClosedRequest(ctx interfaces.ActiveContext)
- func ContextCancelWithBadRequestError(ctx interfaces.ActiveContext, err error)
- func ContextCancelWithBadRequestf(ctx interfaces.ActiveContext, format string, values ...any)
- func ContextCancelWithError(ctx interfaces.ActiveContext, err error)
- func ContextCancelWithErrorAndFormat(ctx interfaces.ActiveContext, err error, format string, values ...any)
- func ContextCancelWithErrorf(ctx interfaces.ActiveContext, format string, values ...any)
- func ContextCloseAfter(ctx interfaces.ActiveContext, closer io.Closer)
- func ContextContinueOrPanic(ctx interfaces.ActiveContext)
- func ContextFlushAfter(ctx interfaces.ActiveContext, closer io.Closer)
- func ContextMustClose(ctx interfaces.ActiveContext, closer io.Closer)
- func ContextMustFlush(ctx interfaces.ActiveContext, flusher Flusher)
- func ContextSetCancelOnSIGHUP(ctx Context)
- func ContextSetCancelOnSIGINT(ctx Context)
- func ContextSetCancelOnSIGTERM(ctx Context)
- func Deferred(err *error, ef func() error)
- func DeferredCloseAndRename(err *error, c io.Closer, oldpath, newpath string)
- func DeferredCloser(err *error, closer io.Closer)
- func DeferredFlusher(err *error, f Flusher)
- func DeferredRecover(err *error)
- func DeferredYieldCloser[T any](yield func(T, error) bool, closer io.Closer)
- func ErrorWithStackf(format string, args ...any) error
- func Errorf(format string, args ...any) (err error)
- func Is(err, target error) bool
- func Is400BadRequest(err error) bool
- func Is499ClientClosedRequest(err error) bool
- func IsAny(err error, funcTargets ...FuncIs) bool
- func IsBrokenPipe(err error) bool
- func IsEOF(err error) bool
- func IsErrNotFound(err error) bool
- func IsErrno(err error, targets ...syscall.Errno) (ok bool)
- func IsExist(err error) bool
- func IsHTTPError(target error, statusCode hs.Code) bool
- func IsNetTimeout(err error) (ok bool)
- func IsNotExist(err error) bool
- func IsNotNilAndNotEOF(err error) bool
- func IsReadlinkInvalidArgument(err error) bool
- func IsSentinel(err, target error) bool
- func IsStopIteration(err error) bool
- func IsTooManyOpenFiles(err error) bool
- func IsTyped[DISAMB any](err error) bool
- func IsWithTimeout(err, target error, timeout time.Duration) bool
- func Join(es ...error) error
- func MakeContext(in ConTeXT.Context) *context
- func MakeContextDefault() *context
- func MakeErrNotFound(value interfaces.Stringer) error
- func MakeErrNotFoundString(s string) error
- func MakeErrStopIteration() error
- func Must(funk FuncErr)
- func PanicIfError(err any)
- func PrintHelpful(printer interfaces.Printer, helpful Helpful)
- func PrintStackTracerIfNecessary(printer interfaces.Printer, name string, err error, _ ...any)
- func RunChildContextWithPrintTicker(parentContext Context, runFunc func(Context), printFunc func(time.Time), ...) (err error)
- func RunContextWithPrintTicker(context Context, runFunc func(Context), printFunc func(time.Time), ...) (err error)
- func WithoutStack(err error) error
- func Wrap(err error) error
- func WrapExceptSentinel(in error, except ...error) (err error)
- func WrapExceptSentinelAsNil(in error, except ...error) (err error)
- func WrapSkip(skip int, err error) error
- func Wrapf(err error, format string, values ...any) error
- type Context
- type ErrNotFound
- type ErrorsIs
- type Flusher
- type FuncContext
- type FuncErr
- type FuncIs
- type FuncNil
- type FuncWithStackInfo
- type Group
- type GroupBuilder
- type Helpful
- type Signal
- type Typed
- type UnwrapMany
- type UnwrapOne
- type WaitGroup
- type WithStackInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Err400BadRequest = newHttpError(hs.Code400BadRequest) Err405MethodNotAllowed = newHttpError(hs.Code405MethodNotAllowed) Err409Conflict = newHttpError(hs.Code409Conflict) Err422UnprocessableEntity = newHttpError(hs.Code409Conflict) Err499ClientClosedRequest = newHttpError(hs.Code499ClientClosedRequest) Err500InternalServerError = newHttpError(hs.Code500InternalServerError) Err501NotImplemented = newHttpError(hs.Code501NotImplemented) )
View Source
var ErrExists = New("exists")
Functions ¶
func CancelWithNotImplemented ¶
func CancelWithNotImplemented(ctx interfaces.ActiveContext)
func ContextCancelWith499ClientClosedRequest ¶
func ContextCancelWith499ClientClosedRequest(ctx interfaces.ActiveContext)
func ContextCancelWithBadRequestError ¶
func ContextCancelWithBadRequestError(ctx interfaces.ActiveContext, err error)
func ContextCancelWithBadRequestf ¶
func ContextCancelWithBadRequestf( ctx interfaces.ActiveContext, format string, values ...any, )
func ContextCancelWithError ¶
func ContextCancelWithError(ctx interfaces.ActiveContext, err error)
func ContextCancelWithErrorAndFormat ¶
func ContextCancelWithErrorAndFormat( ctx interfaces.ActiveContext, err error, format string, values ...any, )
func ContextCancelWithErrorf ¶
func ContextCancelWithErrorf( ctx interfaces.ActiveContext, format string, values ...any, )
func ContextCloseAfter ¶
func ContextCloseAfter(ctx interfaces.ActiveContext, closer io.Closer)
func ContextContinueOrPanic ¶
func ContextContinueOrPanic(ctx interfaces.ActiveContext)
func ContextFlushAfter ¶
func ContextFlushAfter(ctx interfaces.ActiveContext, closer io.Closer)
func ContextMustClose ¶
func ContextMustClose(ctx interfaces.ActiveContext, closer io.Closer)
func ContextMustFlush ¶
func ContextMustFlush(ctx interfaces.ActiveContext, flusher Flusher)
func DeferredCloseAndRename ¶
func DeferredYieldCloser ¶
func MakeContextDefault ¶
func MakeContextDefault() *context
func MakeErrNotFound ¶
func MakeErrNotFound(value interfaces.Stringer) error
func PrintHelpful ¶
func PrintHelpful(printer interfaces.Printer, helpful Helpful)
func PrintStackTracerIfNecessary ¶
func PrintStackTracerIfNecessary( printer interfaces.Printer, name string, err error, _ ...any, )
func RunChildContextWithPrintTicker ¶
func RunContextWithPrintTicker ¶
func WrapExceptSentinel ¶
Wrap the error with stack info unless it's one of the provided `except` errors, in which case return that bare error. Direct value comparison is performed (`in == except`) rather than errors.Is.
func WrapExceptSentinelAsNil ¶
Wrap the error with stack info unless it's one of the provided `except` errors, in which case return nil. Direct value comparison is performed (`in == except`) rather than errors.Is.
Types ¶
type Context ¶
type Context interface {
interfaces.ActiveContext
CauseWithStackFrames() (error, []stack_frame.Frame)
Run(func(Context)) error
// TODO extricate from *context and turn into generic function
SetCancelOnSignals(signals ...os.Signal)
}
type ErrNotFound ¶
type ErrNotFound string
func (ErrNotFound) Error ¶
func (err ErrNotFound) Error() string
func (ErrNotFound) Is ¶
func (err ErrNotFound) Is(target error) (ok bool)
type FuncContext ¶
type FuncContext = interfaces.FuncActiveContext
func MakeFuncContextFromFuncErr ¶
func MakeFuncContextFromFuncErr(in FuncErr) FuncContext
func MakeFuncContextFromFuncNil ¶
func MakeFuncContextFromFuncNil(in FuncNil) FuncContext
type FuncIs ¶
type FuncNil ¶
type FuncNil = func()
type FuncWithStackInfo ¶
type FuncWithStackInfo struct {
FuncErr
stack_frame.Frame
}
type GroupBuilder ¶
type GroupBuilder struct {
// contains filtered or unexported fields
}
func MakeGroupBuilder ¶
func MakeGroupBuilder( errs ...error, ) (groupBuilder *GroupBuilder)
TODO consider making a pool and return a repool func on construction
func (*GroupBuilder) Add ¶
func (groupBuilder *GroupBuilder) Add(err error)
func (*GroupBuilder) Empty ¶
func (groupBuilder *GroupBuilder) Empty() (ok bool)
func (*GroupBuilder) GetError ¶
func (groupBuilder *GroupBuilder) GetError() error
func (*GroupBuilder) Len ¶
func (groupBuilder *GroupBuilder) Len() int
func (*GroupBuilder) Reset ¶
func (groupBuilder *GroupBuilder) Reset()
type Helpful ¶
type Signal ¶
type Typed ¶
type UnwrapMany ¶
type UnwrapMany = interfaces.ErrorManyUnwrapper
type UnwrapOne ¶
type UnwrapOne = interfaces.ErrorOneUnwrapper
type WaitGroup ¶
func MakeWaitGroupParallel ¶
func MakeWaitGroupParallel() WaitGroup
func MakeWaitGroupSerial ¶
func MakeWaitGroupSerial() WaitGroup
type WithStackInfo ¶
type WithStackInfo[T any] struct { Contents T stack_frame.Frame }
Source Files
¶
- context.go
- context_sentinels.go
- deferred.go
- group.go
- group_builder.go
- helpful.go
- http.go
- http_util.go
- interfaces.go
- is.go
- main.go
- main_release.go
- normal.go
- sentinels.go
- signal.go
- wait_group_parallel.go
- wait_group_serial.go
- wrapped_helpful.go
- wrapped_without_stack.go
Click to show internal directories.
Click to hide internal directories.