logrequest

package
v0.0.0-...-f0f63f4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config contains the dependencies for the handler.

func New

func New() *Config

New returns a new logrequest config.

func (*Config) Handler

func (c *Config) Handler(next http.Handler) http.Handler

Handler will log the HTTP requests.

func (*Config) SetClock

func (c *Config) SetClock(clock IClock)

SetClock will set the clock.

func (*Config) SetLog

func (c *Config) SetLog(l ILog)

SetLog will set the logger.

type IClock

type IClock interface {
	Now() time.Time
}

IClock provides clock capabilities.

type ILog

type ILog interface {
	Printf(format string, v ...interface{})
}

ILog provides logging capabilities.

Jump to

Keyboard shortcuts

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