request

package
v0.0.0-...-5560345 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XForwardedFor = "X-Forwarded-For"
	ContentType   = "Content-Type"
)
View Source
const (
	IdLength = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Ip             string
	RequestId      string
	ContentType    string
	Path           string
	Method         string
	UserAgent      string
	HeaderMap      headermap.HeaderMap
	BodyMap        collection.StringMap
	HandleResponse bool
	Header         headermap.HeaderMap
	StatusCode     int
	Body           []byte
}

func NewRequestContext

func NewRequestContext(ctx *fasthttp.RequestCtx) *Context

func (Context) BuildMapping

func (ctx Context) BuildMapping() string

func (*Context) Response

func (ctx *Context) Response(body []byte)

func (*Context) ResponseJSON

func (ctx *Context) ResponseJSON(body any)

type Handler

type Handler interface {
	ordered.PriorityOrdered
	Method() string
	Path() string
	Supports(rctx *Context) bool
	Handle(rctx *Context)
}

Jump to

Keyboard shortcuts

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