Documentation
¶
Index ¶
- Constants
- Variables
- func Error(ctx *fasthttp.RequestCtx, msg string, statusCode int)
- func GetHeader(ctx *fasthttp.RequestCtx, key, defaultV string) string
- func GetParams(ctx *fasthttp.RequestCtx, key, defaultV string) string
- func GetToken(ctx *fasthttp.RequestCtx) string
- func Header(ctx *fasthttp.RequestCtx, key, defaultV string) (string, bool)
- func JsonBody2Object(ctx *fasthttp.RequestCtx, obj any) error
- func JsonBodyUnmarshalObject[T fastjson.Unmarshalable](ctx *fasthttp.RequestCtx, obj T) error
- func Param(ctx *fasthttp.RequestCtx, key string) (string, bool)
- func Params(ctx *fasthttp.RequestCtx) map[string]any
- type RequestChainHandler
- type RequestHandlerChain
Constants ¶
View Source
const ( SUCCESS = 0 FAIL = 1 )
Variables ¶
View Source
var DEFAULT_CONTENTTYPE = []byte("application/json;charset=utf-8")
View Source
var PageResultData = pageResultData{}
View Source
var PageResultDataBuilder = pageResultDataBuilder{}
View Source
var Result = result{}
Functions ¶
func GetHeader ¶ added in v1.0.1
func GetHeader(ctx *fasthttp.RequestCtx, key, defaultV string) string
func GetParams ¶ added in v1.0.1
func GetParams(ctx *fasthttp.RequestCtx, key, defaultV string) string
func GetToken ¶ added in v1.0.1
func GetToken(ctx *fasthttp.RequestCtx) string
func Header ¶ added in v1.0.3
func Header(ctx *fasthttp.RequestCtx, key, defaultV string) (string, bool)
func JsonBody2Object ¶ added in v1.0.1
func JsonBody2Object(ctx *fasthttp.RequestCtx, obj any) error
func JsonBodyUnmarshalObject ¶ added in v1.0.1
func JsonBodyUnmarshalObject[T fastjson.Unmarshalable](ctx *fasthttp.RequestCtx, obj T) error
Types ¶
type RequestChainHandler ¶ added in v1.0.15
type RequestChainHandler func(next fasthttp.RequestHandler) fasthttp.RequestHandler
type RequestHandlerChain ¶ added in v1.0.15
type RequestHandlerChain struct {
// contains filtered or unexported fields
}
func (*RequestHandlerChain) Add ¶ added in v1.0.15
func (c *RequestHandlerChain) Add(handler RequestChainHandler) *RequestHandlerChain
func (*RequestHandlerChain) Then ¶ added in v1.0.15
func (c *RequestHandlerChain) Then(handler fasthttp.RequestHandler) fasthttp.RequestHandler
Click to show internal directories.
Click to hide internal directories.