httpx

package
v0.0.0-...-9c13d9d Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PprofServe

func PprofServe(opt ...Option) <-chan error

PprofServe start pprof server

func PprofShutdown

func PprofShutdown() error

PprofShutdown shutdown pprof server

func Router

func Router() *mux.Router

Router gives access to the underlying router for when new routes need to be added.

Types

type Option

type Option func(o *options)

Option Option fucntion

func WithAddress

func WithAddress(addr string) Option

WithAddress sets the pprof address default is ":8081"

func WithShutdownTimeOut

func WithShutdownTimeOut(t time.Duration) Option

WithShutdownTimeOut sets the shutdown time out default is 3s

type ResponseWriter

type ResponseWriter interface {
	http.ResponseWriter
	http.Flusher
	Status() int
	Size() int
}

ResponseWriter 响应

func BuildResponseMid

func BuildResponseMid(w http.ResponseWriter) ResponseWriter

BuildResponseMid http 注入获取 StatusCode 等信息

Jump to

Keyboard shortcuts

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