interceptor

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFatal = Fatal{
	ExitCode: support.PInt(13),
}

Functions

This section is empty.

Types

type Fatal

type Fatal struct {
	ExitCode *int
}

func (Fatal) OnAfterLog

func (instance Fatal) OnAfterLog(event log.Event, _ log.Provider) (canContinue bool)

func (Fatal) OnBeforeLog

func (instance Fatal) OnBeforeLog(event log.Event, _ log.Provider) (intercepted log.Event)

type Interceptor

type Interceptor interface {
	OnBeforeLog(log.Event, log.Provider) (intercepted log.Event)
	OnAfterLog(log.Event, log.Provider) (canContinue bool)
	GetPriority() int16
}
var Default Interceptor = Interceptors{}

func Noop

func Noop() Interceptor

type Interceptors

type Interceptors []Interceptor

func (*Interceptors) Add added in v0.4.0

func (instance *Interceptors) Add(v Interceptor) *Interceptors

func (Interceptors) GetPriority added in v0.4.0

func (instance Interceptors) GetPriority() int16

func (Interceptors) Len added in v0.4.0

func (instance Interceptors) Len() int

func (Interceptors) Less added in v0.4.0

func (instance Interceptors) Less(i, j int) bool

func (Interceptors) OnAfterLog

func (instance Interceptors) OnAfterLog(event log.Event, provider log.Provider) (canContinue bool)

func (Interceptors) OnBeforeLog

func (instance Interceptors) OnBeforeLog(event log.Event, provider log.Provider) (intercepted log.Event)

func (Interceptors) Swap added in v0.4.0

func (instance Interceptors) Swap(i, j int)

Jump to

Keyboard shortcuts

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