Versions in this module Expand all Collapse all v1 v1.0.3 Apr 25, 2022 Changes in this version + const AbortIndex + const TimeFormat + const Version + func DetectContentType(data []byte) string + func ErrCode(err error, def ...int) int + func ErrorReply(w http.ResponseWriter, error string, code int) + func FileServer2(root http.FileSystem) http.Handler + func GetAppPath() string + func PanicHandler(forward http.Handler, logwriter func(string)) http.HandlerFunc + func ParseTime(text string) (t time.Time, err error) + func RecoverFn(logwriter func(string)) func() + func ServeFile2(w http.ResponseWriter, r *http.Request, name string) + type Context struct + HasError bool + Keys map[string]interface{} + Request *http.Request + Writer IWriter + func (c *Context) Abort() + func (c *Context) AbortWithStatus(code int) + func (c *Context) AddError(err error) + func (c *Context) AddLog(info ...string) + func (c *Context) ClientIP() string + func (c *Context) Data(code int, contentType string, data []byte) + func (c *Context) File(filepath string) + func (c *Context) Get(key string) (value interface{}, exists bool) + func (c *Context) GetErrors() []error + func (c *Context) GetLogs() []string + func (c *Context) JSON(code int, v interface{}) + func (c *Context) MustGet(key string) interface{} + func (c *Context) Next() + func (c *Context) Param(name string) string + func (c *Context) Query(key string) string + func (c *Context) QueryByte(key string, def byte) byte + func (c *Context) QueryFloat64(key string, def float64) float64 + func (c *Context) QueryInt(key string, def int) int + func (c *Context) QueryInt64(key string, def int64) int64 + func (c *Context) QueryString(key, def string) string + func (c *Context) QueryUint(key string, def uint) uint + func (c *Context) ReadBody() []byte + func (c *Context) ReadReqBodyJson(v interface{}) error + func (c *Context) Redirect(code int, Location string) + func (c *Context) Set(key string, value interface{}) + func (c *Context) String(code int, format string, values ...interface{}) + type Engine struct + func NewServeMux() *Engine + type ErrorWithPos interface + String func() string + Where func() []string + func Error(err error, code ...int) ErrorWithPos + func ErrorAppend(err error, szExtra ...string) ErrorWithPos + func Errorf(code int, format string, a ...interface{}) ErrorWithPos + type H = map[string]interface + type HandlerFunc func(*Context) + func Logger(bShowReqBody bool, bShowRespBody bool) HandlerFunc + func LoggerWithFunc(bShowReqBody bool, bShowRespBody bool, fn LoggerFunc) HandlerFunc + type IWriter interface + GetRespBody func() io.Reader + GetStatusCode func() int + Init func(w http.ResponseWriter) + SetRecordRespBody func(bool) + func NewWriter(w http.ResponseWriter) IWriter + type LoggerFunc func(c *Context, szLog []byte) + func DefaultLoggerFunc() LoggerFunc + type Router struct + func (r *Router) Any(path string, handlers ...HandlerFunc) + func (r *Router) CONNECT(path string, handlers ...HandlerFunc) + func (r *Router) DELETE(path string, handlers ...HandlerFunc) + func (r *Router) GET(path string, handlers ...HandlerFunc) + func (r *Router) Group(handlers ...HandlerFunc) *Router + func (r *Router) HEAD(path string, handlers ...HandlerFunc) + func (r *Router) Handle(method, path string, handlers []HandlerFunc) + func (r *Router) OPTIONS(path string, handlers ...HandlerFunc) + func (r *Router) PATCH(path string, handlers ...HandlerFunc) + func (r *Router) POST(path string, handlers ...HandlerFunc) + func (r *Router) PUT(path string, handlers ...HandlerFunc) + func (r *Router) ServeDir(prefix string, dir string) + func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (r *Router) TRACE(path string, handlers ...HandlerFunc) + func (r *Router) Use(middlewares ...HandlerFunc) *Router + func (r *Router) UseNotFound(fn HandlerFunc) + type WriterImpl struct + func (this *WriterImpl) GetRespBody() io.Reader + func (this *WriterImpl) GetStatusCode() int + func (this *WriterImpl) Header() http.Header + func (this *WriterImpl) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (this *WriterImpl) Init(w http.ResponseWriter) + func (this *WriterImpl) SetRecordRespBody(bRecordBody bool) + func (this *WriterImpl) Write(p []byte) (int, error) + func (this *WriterImpl) WriteHeader(status int) v1.0.2 Feb 24, 2022