reqlog

package
v0.0.0-...-0d6bb38 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromConfig

func FromConfig(name string, conf config.ReqLog) error

func NewContext

func NewContext(ctx context.Context, log *Log) context.Context

func ReopenAll

func ReopenAll()

Types

type Event

type Event struct {
	T time.Time
	H *http.Request
	R *RawRequest

	Status int
	Length int64

	Latency time.Duration
}

type Log

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

func FromContext

func FromContext(ctx context.Context) *Log

func FromName

func FromName(name string) *Log

func New

func New(path string, nbuf int, format string) (*Log, error)

func (*Log) Log

func (h *Log) Log(e *Event)

func (*Log) Reopen

func (h *Log) Reopen()

type RawRequest

type RawRequest struct {
	RemoteAddr net.Addr
	LocalAddr  net.Addr
}

Jump to

Keyboard shortcuts

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