Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToString(b []byte) string
- func InvalidPath(path string)
- func MapFormWithTag(ptr any, form map[string][]string, tag string) error
- func StringToBytes(s string) []byte
- func Wrap(f func(w http.ResponseWriter, r *http.Request)) func(*Context)
- type Context
- func (ctx *Context) Abort()
- func (ctx *Context) Bind(v any) error
- func (ctx *Context) BindJSON(v any) error
- func (ctx *Context) BindQuery(v any) error
- func (ctx *Context) City() string
- func (ctx *Context) Clone() (ctxClone *Context)
- func (ctx *Context) Deadline() (deadline time.Time, ok bool)
- func (ctx *Context) Done() <-chan struct{}
- func (ctx *Context) Err() error
- func (ctx *Context) Exception(resp Response)
- func (ctx *Context) Get(key string) any
- func (ctx *Context) GetBody() []byte
- func (ctx *Context) GetBool(key string) bool
- func (ctx *Context) GetFloat32(key string) float32
- func (ctx *Context) GetFloat64(key string) float64
- func (ctx *Context) GetInt(key string) int
- func (ctx *Context) GetInt64(key string) int64
- func (ctx *Context) GetString(key string) string
- func (ctx *Context) GetUint(key string) uint
- func (ctx *Context) GetUint64(key string) uint64
- func (ctx *Context) Header() http.Header
- func (ctx *Context) HeaderAdd(key, value string)
- func (ctx *Context) HeaderClone() http.Header
- func (ctx *Context) HeaderDel(key string)
- func (ctx *Context) HeaderGet(key string) string
- func (ctx *Context) HeaderSet(key, value string)
- func (ctx *Context) HeaderValues(key string) []string
- func (ctx *Context) HeaderWrite(w io.Writer) error
- func (ctx *Context) HeaderWriteSubset(w io.Writer, exclude map[string]bool) error
- func (ctx *Context) JSON(statusCode int, body any)
- func (ctx *Context) Next()
- func (ctx *Context) Param(key string) string
- func (ctx *Context) RealIP() string
- func (ctx *Context) RequestHeader() http.Header
- func (ctx *Context) Set(key string, val any)
- func (ctx *Context) Success(body any)
- func (ctx *Context) Traceid() string
- func (ctx *Context) UserPrior() uint8
- func (ctx *Context) Userid() string
- func (ctx *Context) Username() string
- func (ctx *Context) Value(key any) any
- func (ctx *Context) Write(p []byte) (int, error)
- func (ctx *Context) WriteHeader(statusCode int)
- type Handler
- type Handlers
- type JSON
- type Node
- type Pair
- type Response
- type Router
- func (router *Router) Add(meth, path string, fn ...Handler)
- func (router *Router) DELETE(path string, fn ...Handler)
- func (router *Router) GET(path string, fn ...Handler)
- func (router *Router) Group(fn ...Handler) *Router
- func (router *Router) PATCH(path string, fn ...Handler)
- func (router *Router) POST(path string, fn ...Handler)
- func (router *Router) PUT(path string, fn ...Handler)
- func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (router *Router) Use(fn ...Handler)
- func (router *Router) WithPprof()
Constants ¶
const AbortIndex int8 = math.MaxInt8 >> 1
AbortIndex represents a typical value used in abort functions.
Variables ¶
var ( // ErrConvertMapStringSlice can not covert to map[string][]string ErrConvertMapStringSlice = errors.New("can not convert to map slices of strings") // ErrConvertToMapString can not convert to map[string]string ErrConvertToMapString = errors.New("can not convert to map of strings") )
var EnableDecoderDisallowUnknownFields = false
EnableDecoderDisallowUnknownFields is used to call the DisallowUnknownFields method on the JSON Decoder instance. DisallowUnknownFields causes the Decoder to return an error when the destination is a struct and the input contains object keys which do not match any non-ignored, exported fields in the destination.
var EnableDecoderUseNumber = false
EnableDecoderUseNumber is used to call the UseNumber method on the JSON Decoder instance. UseNumber causes the Decoder to unmarshal a number into an interface{} as a Number instead of as a float64.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to string without a memory allocation.
func StringToBytes ¶
StringToBytes converts string to byte slice without a memory allocation.
Types ¶
type Context ¶
type Context struct { Request *http.Request Response http.ResponseWriter Cancel context.CancelFunc // contains filtered or unexported fields }
func (*Context) GetFloat32 ¶
func (*Context) GetFloat64 ¶
func (*Context) HeaderClone ¶
func (*Context) HeaderValues ¶
func (*Context) HeaderWriteSubset ¶
func (*Context) RequestHeader ¶
---------- Request ---------- ---------- Request Header ----------