Versions in this module Expand all Collapse all v0 v0.1.1 Oct 15, 2023 Changes in this version + func GetHandlerName(handler HandlerFunc) string + func ParseByteRange(byteRange []byte, contentLength int) (startPos, endPos int, err error) + func ServeFile(ctx *RequestContext, path string) + func ServeFileUncompressed(ctx *RequestContext, path string) + func SetClientIPFunc(fn ClientIP) + func SetHandlerName(handler HandlerFunc, name string) + type ClientIP func(ctx *RequestContext) string + func ClientIPWithOption(opts ClientIPOptions) ClientIP + type ClientIPOptions struct + RemoteIPHeaders []string + TrustedCIDRs []*net.IPNet + type FS struct + AcceptByteRange bool + CacheDuration time.Duration + Compress bool + CompressedFileSuffix string + GenerateIndexPages bool + IndexNames []string + PathNotFound HandlerFunc + PathRewrite PathRewriteFunc + Root string + func (fs *FS) NewRequestHandler() HandlerFunc + type FormValueFunc func(*RequestContext, string) []byte + type Handler interface + ServeHTTP func(c context.Context, ctx *RequestContext) + type HandlerFunc func(c context.Context, ctx *RequestContext) + type HandlersChain []HandlerFunc + func (c HandlersChain) Last() HandlerFunc + type HijackHandler func(c network.Conn) + type PathRewriteFunc func(ctx *RequestContext) []byte + func NewPathSlashesStripper(slashesCount int) PathRewriteFunc + func NewVHostPathRewriter(slashesCount int) PathRewriteFunc + type RequestContext struct + Errors errors.ErrorChain + HTMLRender render.HTMLRender + Keys map[string]interface{} + Params param.Params + Request protocol.Request + Response protocol.Response + func NewContext(maxParams uint16) *RequestContext + func (ctx *RequestContext) Abort() + func (ctx *RequestContext) AbortWithError(code int, err error) *errors.Error + func (ctx *RequestContext) AbortWithMsg(msg string, statusCode int) + func (ctx *RequestContext) AbortWithStatus(code int) + func (ctx *RequestContext) AbortWithStatusJSON(code int, jsonObj interface{}) + func (ctx *RequestContext) Bind(obj interface{}) error + func (ctx *RequestContext) BindAndValidate(obj interface{}) error + func (ctx *RequestContext) BindByContentType(obj interface{}) error + func (ctx *RequestContext) BindForm(obj interface{}) error + func (ctx *RequestContext) BindHeader(obj interface{}) error + func (ctx *RequestContext) BindJSON(obj interface{}) error + func (ctx *RequestContext) BindPath(obj interface{}) error + func (ctx *RequestContext) BindProtobuf(obj interface{}) error + func (ctx *RequestContext) BindQuery(obj interface{}) error + func (ctx *RequestContext) Body() ([]byte, error) + func (ctx *RequestContext) ClientIP() string + func (ctx *RequestContext) ContentType() []byte + func (ctx *RequestContext) Cookie(key string) []byte + func (ctx *RequestContext) Copy() *RequestContext + func (ctx *RequestContext) Data(code int, contentType string, data []byte) + func (ctx *RequestContext) DefaultPostForm(key, defaultValue string) string + func (ctx *RequestContext) DefaultQuery(key, defaultValue string) string + func (ctx *RequestContext) Error(err error) *errors.Error + func (ctx *RequestContext) File(filepath string) + func (ctx *RequestContext) FileAttachment(filepath, filename string) + func (ctx *RequestContext) FileFromFS(filepath string, fs *FS) + func (ctx *RequestContext) Finished() <-chan struct{} + func (ctx *RequestContext) Flush() error + func (ctx *RequestContext) ForEachKey(fn func(k string, v interface{})) + func (ctx *RequestContext) FormFile(name string) (*multipart.FileHeader, error) + func (ctx *RequestContext) FormValue(key string) []byte + func (ctx *RequestContext) FullPath() string + func (ctx *RequestContext) Get(key string) (value interface{}, exists bool) + func (ctx *RequestContext) GetBool(key string) (b bool) + func (ctx *RequestContext) GetConn() network.Conn + func (ctx *RequestContext) GetDuration(key string) (d time.Duration) + func (ctx *RequestContext) GetFloat32(key string) (f32 float32) + func (ctx *RequestContext) GetFloat64(key string) (f64 float64) + func (ctx *RequestContext) GetHeader(key string) []byte + func (ctx *RequestContext) GetHijackHandler() HijackHandler + func (ctx *RequestContext) GetIndex() int8 + func (ctx *RequestContext) GetInt(key string) (i int) + func (ctx *RequestContext) GetInt32(key string) (i32 int32) + func (ctx *RequestContext) GetInt64(key string) (i64 int64) + func (ctx *RequestContext) GetPostForm(key string) (string, bool) + func (ctx *RequestContext) GetQuery(key string) (string, bool) + func (ctx *RequestContext) GetRawData() []byte + func (ctx *RequestContext) GetReader() network.Reader + func (ctx *RequestContext) GetRequest() (dst *protocol.Request) + func (ctx *RequestContext) GetResponse() (dst *protocol.Response) + func (ctx *RequestContext) GetString(key string) (s string) + func (ctx *RequestContext) GetStringMap(key string) (sm map[string]interface{}) + func (ctx *RequestContext) GetStringMapString(key string) (sms map[string]string) + func (ctx *RequestContext) GetStringMapStringSlice(key string) (smss map[string][]string) + func (ctx *RequestContext) GetStringSlice(key string) (ss []string) + func (ctx *RequestContext) GetTime(key string) (t time.Time) + func (ctx *RequestContext) GetTraceInfo() traceinfo.TraceInfo + func (ctx *RequestContext) GetUint(key string) (ui uint) + func (ctx *RequestContext) GetUint32(key string) (ui32 uint32) + func (ctx *RequestContext) GetUint64(key string) (ui64 uint64) + func (ctx *RequestContext) GetWriter() network.Writer + func (ctx *RequestContext) HTML(code int, name string, obj interface{}) + func (ctx *RequestContext) Handler() HandlerFunc + func (ctx *RequestContext) HandlerName() string + func (ctx *RequestContext) Handlers() HandlersChain + func (ctx *RequestContext) Header(key, value string) + func (ctx *RequestContext) Hijack(handler HijackHandler) + func (ctx *RequestContext) Hijacked() bool + func (ctx *RequestContext) Host() []byte + func (ctx *RequestContext) IfModifiedSince(lastModified time.Time) bool + func (ctx *RequestContext) IndentedJSON(code int, obj interface{}) + func (ctx *RequestContext) IsAborted() bool + func (ctx *RequestContext) IsEnableTrace() bool + func (ctx *RequestContext) IsGet() bool + func (ctx *RequestContext) IsHead() bool + func (ctx *RequestContext) IsPost() bool + func (ctx *RequestContext) JSON(code int, obj interface{}) + func (ctx *RequestContext) Method() []byte + func (ctx *RequestContext) MultipartForm() (*multipart.Form, error) + func (ctx *RequestContext) MustGet(key string) interface{} + func (ctx *RequestContext) Next(c context.Context) + func (ctx *RequestContext) NotFound() + func (ctx *RequestContext) NotModified() + func (ctx *RequestContext) Param(key string) string + func (ctx *RequestContext) Path() []byte + func (ctx *RequestContext) PostArgs() *protocol.Args + func (ctx *RequestContext) PostForm(key string) string + func (ctx *RequestContext) ProtoBuf(code int, obj interface{}) + func (ctx *RequestContext) PureJSON(code int, obj interface{}) + func (ctx *RequestContext) Query(key string) string + func (ctx *RequestContext) QueryArgs() *protocol.Args + func (ctx *RequestContext) Redirect(statusCode int, uri []byte) + func (ctx *RequestContext) RemoteAddr() net.Addr + func (ctx *RequestContext) Render(code int, r render.Render) + func (ctx *RequestContext) RequestBodyStream() io.Reader + func (ctx *RequestContext) Reset() + func (ctx *RequestContext) ResetWithoutConn() + func (ctx *RequestContext) SaveUploadedFile(file *multipart.FileHeader, dst string) error + func (ctx *RequestContext) Set(key string, value interface{}) + func (ctx *RequestContext) SetBinder(binder binding.Binder) + func (ctx *RequestContext) SetBodyStream(bodyStream io.Reader, bodySize int) + func (ctx *RequestContext) SetBodyString(body string) + func (ctx *RequestContext) SetClientIPFunc(f ClientIP) + func (ctx *RequestContext) SetConn(c network.Conn) + func (ctx *RequestContext) SetConnectionClose() + func (ctx *RequestContext) SetContentType(contentType string) + func (ctx *RequestContext) SetContentTypeBytes(contentType []byte) + func (ctx *RequestContext) SetCookie(name, value string, maxAge int, path, domain string, ...) + func (ctx *RequestContext) SetEnableTrace(enable bool) + func (ctx *RequestContext) SetFormValueFunc(f FormValueFunc) + func (ctx *RequestContext) SetFullPath(p string) + func (ctx *RequestContext) SetHandlers(hc HandlersChain) + func (ctx *RequestContext) SetHijackHandler(h HijackHandler) + func (ctx *RequestContext) SetStatusCode(statusCode int) + func (ctx *RequestContext) SetTraceInfo(t traceinfo.TraceInfo) + func (ctx *RequestContext) SetValidator(validator binding.StructValidator) + func (ctx *RequestContext) Status(code int) + func (ctx *RequestContext) String(code int, format string, values ...interface{}) + func (ctx *RequestContext) URI() *protocol.URI + func (ctx *RequestContext) UserAgent() []byte + func (ctx *RequestContext) Validate(obj interface{}) error + func (ctx *RequestContext) Value(key interface{}) interface{} + func (ctx *RequestContext) VisitAllCookie(f func(key, value []byte)) + func (ctx *RequestContext) VisitAllHeaders(f func(key, value []byte)) + func (ctx *RequestContext) VisitAllPostArgs(f func(key, value []byte)) + func (ctx *RequestContext) VisitAllQueryArgs(f func(key, value []byte)) + func (ctx *RequestContext) Write(p []byte) (int, error) + func (ctx *RequestContext) WriteString(s string) (int, error) + func (ctx *RequestContext) XML(code int, obj interface{})