interceptor

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 3 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)
}
var Default Interceptor = Interceptors{}

func Noop

func Noop() Interceptor

type Interceptors

type Interceptors []Interceptor

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) With

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

Jump to

Keyboard shortcuts

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