Documentation ¶
Index ¶
- func New() app.ContextScope
- func NewIsolated(parent app.ContextScope) app.ContextScope
- type ContextScope
- func (s *ContextScope) AppendError(errs ...error)
- func (s *ContextScope) Deadline() (deadline time.Time, ok bool)
- func (s *ContextScope) Done() <-chan struct{}
- func (s *ContextScope) Err() error
- func (s *ContextScope) Errors() []error
- func (s *ContextScope) IsDone() bool
- func (s *ContextScope) Kill()
- func (s *ContextScope) Stop()
- type Isolated
- func (scp *Isolated) AppendError(errs ...error)
- func (scp *Isolated) Deadline() (deadline time.Time, ok bool)
- func (scp *Isolated) Done() <-chan struct{}
- func (scp *Isolated) Err() error
- func (scp *Isolated) Errors() []error
- func (scp *Isolated) IsDone() bool
- func (scp *Isolated) Kill()
- func (scp *Isolated) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIsolated ¶
func NewIsolated(parent app.ContextScope) app.ContextScope
NewIsolated create new isolated context scope instance
Types ¶
type ContextScope ¶
type ContextScope struct {
// contains filtered or unexported fields
}
ContextScope is default context scope
func (*ContextScope) AppendError ¶
func (s *ContextScope) AppendError(errs ...error)
AppendErrors append many errors to scope (skip nil errors)
func (*ContextScope) Deadline ¶
func (s *ContextScope) Deadline() (deadline time.Time, ok bool)
Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.
func (*ContextScope) Done ¶
func (s *ContextScope) Done() <-chan struct{}
Done is close when the scope context is done (kill or stop)
func (*ContextScope) Err ¶
func (s *ContextScope) Err() error
Err return cumulative error if the scope context contains any error
func (*ContextScope) IsDone ¶
func (s *ContextScope) IsDone() bool
IsDone check if the scope context is done (kill or stop)
type Isolated ¶
type Isolated struct {
// contains filtered or unexported fields
}
The isolated scope is a isolated context scope depended from parent scope. The isolated scope doesn't affect parent.
func (*Isolated) AppendError ¶
AppendErrors append many errors to scope (skip nil errors)
func (*Isolated) Deadline ¶
Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.
func (*Isolated) Done ¶
func (scp *Isolated) Done() <-chan struct{}
Done is close when the scope context is done (kill or stop)