httplog

package
v0.0.0-...-4e12403 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPLog

type HTTPLog struct {
	Time       time.Time
	ClientIP   string
	BackendIP  string
	Proto      string
	TLS        bool
	Method     string
	StatusCode int
	Schema     string
	Host       string
	User       string
	URL        string
	UserAgent  string
	Cookies    int
	RespTTFMS  float64
	RespTimeMS float64
	ReqBytes   int
	RespBytes  int
	HIT        bool
	RateLimit  bool
	Device     int
	CustomTags []string
	// contains filtered or unexported fields
}

func New

func New(r *http.Request, w http.ResponseWriter, fnHeaders func(w http.ResponseWriter) []string) *HTTPLog

func (*HTTPLog) Done

func (hl *HTTPLog) Done()

func (*HTTPLog) GetKeyStr

func (hl *HTTPLog) GetKeyStr() string

GetKeyStr return a uniq string for each url IMPORTANT: This is the key of the cache engine, if this do not generate the correct string will fuck the cache

func (*HTTPLog) GetKeyStrDevice

func (hl *HTTPLog) GetKeyStrDevice(device int) string

func (*HTTPLog) Header

func (hl *HTTPLog) Header() http.Header

func (HTTPLog) MarshalJSON

func (hl HTTPLog) MarshalJSON() []byte

func (HTTPLog) MarshalString

func (hl HTTPLog) MarshalString() string

func (*HTTPLog) Write

func (hl *HTTPLog) Write(b []byte) (int, error)

func (*HTTPLog) WriteHeader

func (hl *HTTPLog) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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