zhttp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package zhttp provides zap extensions and middleware for Go's HTTP standard library.

TODO: examples

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFields

type LogFields []func(context.Context) zap.Field

LogFields customizes the fields logged

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware is the zapx/zhttp middleware client

func NewMiddleware

func NewMiddleware(l *zap.Logger, f LogFields) *Middleware

NewMiddleware instantiates a middleware function that logs all requests using the provided logger

func (*Middleware) Logger

func (m *Middleware) Logger(next http.Handler) http.Handler

Logger is basic logging middleware

func (*Middleware) Recoverer

func (m *Middleware) Recoverer(next http.Handler) http.Handler

Recoverer is middleware for logging panics

Jump to

Keyboard shortcuts

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