Versions in this module Expand all Collapse all v0 v0.1.3 Sep 4, 2023 Changes in this version + const BodyAsciiJSON + const BodyDownload + const BodyGif + const BodyHTML + const BodyJPG + const BodyJSON + const BodyJavaScript + const BodyOctet + const BodyPDF + const BodyPNG + const BodyPlain + const BodyWord + const BodyXML + const BodyYAML + const Logo + var Path = os.Getwd() + func Base(next http.Handler) http.Handler + func BaseFunc(next http.Handler) http.HandlerFunc + func CorsHandler() gin.HandlerFunc + func GetClientIp(r *http.Request) string + func GetCookie(r *http.Request, name string) (*http.Cookie, error) + func GetCookieVal(r *http.Request, name string) string + func GetFromArg(r *http.Request, name string) string + func GetFromFile(r *http.Request, name string) (multipart.File, *multipart.FileHeader, error) + func GetHeader(r *http.Request, name string) string + func GetIP(r *http.Request) (ip string) + func GetIp(r *http.Request) (ip string) + func GetJsonParam(r *http.Request, param interface{}) + func GetUrlArg(r *http.Request, name string) string + func GetUrlArgInt(r *http.Request, name string) int + func GetUrlArgInt64(r *http.Request, name string) int64 + func Health(w http.ResponseWriter, r *http.Request) + func Hello(w http.ResponseWriter, r *http.Request) + func Out404(w http.ResponseWriter) + func OutErrBody(w http.ResponseWriter, code int, err error) + func OutJPG(w http.ResponseWriter, path string) + func OutPdf(w http.ResponseWriter, path string) + func OutStaticFile(w http.ResponseWriter, path string) + func OutSucceedBody(w http.ResponseWriter, data interface{}) + func OutSucceedBodyJsonP(w http.ResponseWriter, data interface{}) + func OutUploadFile(w http.ResponseWriter, path, fileName string) + func ReqLimit(ipv *IpVisitor, nextHeader http.Handler) http.Handler + func SetCookie(w http.ResponseWriter, name, value string, t int) + func SetCookieMap(w http.ResponseWriter, data map[string]string, t int) + func SetSockOptInt() net.ListenConfig + type Engine struct + func NewEngine() *Engine + func SimpleEngine() *Engine + func (engine *Engine) GetMux() *http.ServeMux + func (engine *Engine) OpenPprof() + func (engine *Engine) Router(path string, f func(w http.ResponseWriter, r *http.Request)) + func (engine *Engine) RouterFunc(path string, f func(w http.ResponseWriter, r *http.Request)) + func (engine *Engine) Run(port string) + type HttpOutBody struct + Code int + Data interface{} + Msg string + Timestamp int64 + func (m *HttpOutBody) JsonStr() (string, error) + type IpVisitor struct + BlackList map[string]struct{} + WhiteList map[string]struct{} + func NewIpVisitor() *IpVisitor + func (ipv *IpVisitor) AddBlackList(ip string) + func (ipv *IpVisitor) AddVisitor(ip string) *rate.Limiter + func (ipv *IpVisitor) AddWhiteList(ip string) + func (ipv *IpVisitor) CleanupVisitors() + func (ipv *IpVisitor) DelBlackList(ip string) + func (ipv *IpVisitor) DelWhiteList(ip string) + func (ipv *IpVisitor) GetVisitor(ip string) *rate.Limiter + func (ipv *IpVisitor) IsBlackList(ip string) (ok bool) + func (ipv *IpVisitor) IsWhiteList(ip string) (ok bool) + type ResponseWriter struct + StatusCode int + func NewResponseWriter(w http.ResponseWriter) *ResponseWriter + func (lrw *ResponseWriter) WriteHeader(code int)