interceptor

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Aware

type Aware interface {
	GetInterceptor() Interceptor
	SetInterceptor(Interceptor)
}

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

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

type Panics

type Panics struct {
	Panics bool
}

func (Panics) OnAfterLog

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

func (Panics) OnBeforeLog

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

Jump to

Keyboard shortcuts

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