stack

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package stack is an error wrapper and put it to a stack using passed context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stacker

type Stacker struct{}

Stacker is error stack client.

func New

func New() *Stacker

New to create new error stacker.

func (*Stacker) Get

func (s *Stacker) Get(ctx context.Context) interface{}

Get returns the errors stack from context. Will return stack starts from the first/deepest wrapped error.

func (*Stacker) Init

func (s *Stacker) Init(ctx context.Context) context.Context

Init to init context so it can be used as an error stack.

func (*Stacker) Wrap

func (s *Stacker) Wrap(ctx context.Context, err error, errs ...error) error

Wrap to wrap the errors and put them in the stack in the initiated context.

Jump to

Keyboard shortcuts

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