Documentation ¶
Index ¶
- Constants
- Variables
- func HttpGetByFunc(url string, fHandle func(buf []byte)) error
- func HttpPostByFunc(url string, form url.Values, fHandle func(buf []byte)) error
- func Init(webPath string, fs embed.FS, routerFuncList ...func(*httprouter.Router)) *httprouter.Router
- func ResponseDirect(w http.ResponseWriter, r *http.Request, data []byte, strType string)
- func ResponseError(w http.ResponseWriter, r *http.Request, errorInfo string)
- func ResponseOk(w http.ResponseWriter, r *http.Request, data interface{})
- func ResponseOkIndent(w http.ResponseWriter, r *http.Request, data interface{}, ...)
- func ResponseRedirect(w http.ResponseWriter, r *http.Request, url string)
- func ResponseToken(w http.ResponseWriter, r *http.Request, data interface{}, token string)
- func Run(ctx context.Context, port string, router *httprouter.Router, ...)
- func WebDecryptParams(r *http.Request, decryptFunc func(s string, v *url.Values)) url.Values
- func WebParams(r *http.Request) url.Values
- type WebResponse
Constants ¶
View Source
const ( C_Data_Pass = "pass" C_Data_Pending = "pending" C_Data_Success = "successed" C_Error_Denied = "permission denied" C_Error_InvalidParams = "invalid request params" )
Variables ¶
View Source
var EnableLog = true
Functions ¶
func HttpPostByFunc ¶
func Init ¶
func Init(webPath string, fs embed.FS, routerFuncList ...func(*httprouter.Router)) *httprouter.Router
func ResponseDirect ¶
http.Response
func ResponseError ¶
func ResponseError(w http.ResponseWriter, r *http.Request, errorInfo string)
func ResponseOk ¶
func ResponseOk(w http.ResponseWriter, r *http.Request, data interface{})
func ResponseOkIndent ¶
func ResponseOkIndent(w http.ResponseWriter, r *http.Request, data interface{}, prefix, indent string)
func ResponseRedirect ¶
func ResponseRedirect(w http.ResponseWriter, r *http.Request, url string)
func ResponseToken ¶
func ResponseToken(w http.ResponseWriter, r *http.Request, data interface{}, token string)
func WebDecryptParams ¶
Types ¶
type WebResponse ¶
====================================== http =========================================
Click to show internal directories.
Click to hide internal directories.