context

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextPool = sync.Pool{
	New: func() interface{} {
		return &Context{
			Request: Request{
				Body:    make([]byte, 0),
				Headers: http.Header{},
			},
			Response: Response{
				Body:       make([]byte, 0),
				StatusCode: 200,
			},
		}
	},
}

Functions

This section is empty.

Types

type Context

type Context struct {
	Request  Request
	Response Response
}

func FromHttp

func FromHttp(request *http.Request) *Context

type Request

type Request struct {
	Body    []byte
	Headers http.Header
	Ip      net.IP
}

type Response

type Response struct {
	Body       []byte
	StatusCode int
}

Jump to

Keyboard shortcuts

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