reqlogger

package
v0.0.0-...-e46c3b8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Name       string
	Message    string
	Data       interface{}
	StatusCode int
	Err        error
}

Error represents the data for and error to be logged.

type Logger

type Logger interface {
	Request(req Request)
	Response(req Request, d time.Duration, status int)
	Error(req Request, d time.Duration, err Error)
	Sync() error
}

Logger abstracts request logger.

func New

func New(logger *zap.Logger) Logger

New constructs new request logger.

type Request

type Request struct {
	Method string
	URL    string
	IP     string
	ID     string
}

Request represents request data to be logged.

Jump to

Keyboard shortcuts

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