testutil

package
v0.168.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestContextWithLoggerHook added in v0.129.0

func TestContextWithLoggerHook(ctx context.Context, hook *TestHook) context.Context

Types

type TestHook

type TestHook struct {
	Entries []log.LogEntry
}

func LoggerHookContextMiddleware added in v0.129.0

func LoggerHookContextMiddleware() (func(next http.Handler) http.Handler, *TestHook)

func NewTestContextWithLoggerHook

func NewTestContextWithLoggerHook() (context.Context, *TestHook)

func (*TestHook) LastEntry

func (t *TestHook) LastEntry() *log.LogEntry

func (*TestHook) OnLogged

func (t *TestHook) OnLogged(entry *log.LogEntry) error

Jump to

Keyboard shortcuts

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