httphandler

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpHandler

type HttpHandler struct {
	RequestHandlers  func(http.Request)
	ResponseHandlers func(http.Response)
	MonitorHandlers  func(*MonitorMetric)
}

func NewHttpHandler

func NewHttpHandler() *HttpHandler

func (*HttpHandler) AddMonitorHandler

func (handler *HttpHandler) AddMonitorHandler(monitorHandler func(*MonitorMetric)) *HttpHandler

func (*HttpHandler) AddRequestHandler

func (handler *HttpHandler) AddRequestHandler(requestHandler func(http.Request)) *HttpHandler

func (*HttpHandler) AddResponseHandler

func (handler *HttpHandler) AddResponseHandler(responseHandler func(response http.Response)) *HttpHandler

type MonitorMetric

type MonitorMetric struct {
	Host          string
	Path          string
	Method        string
	Raw           string
	UserAgent     string
	RequestId     string
	StatusCode    int
	ContentLength int64
	Latency       time.Duration
}

Jump to

Keyboard shortcuts

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