Documentation
¶
Index ¶
- func CheckMixedRouter(requestRouterFlag string, requestRouterKey int, next http.Handler) http.Handler
- func CheckMixedRouterWithHandler(requestRouterFlag string, ...) http.Handler
- func DownloadFile(targetURL, localPath string) (fileName, pathString string, err error)
- func DownloadFileWithFormat(targetURL, localPath, format string, headers map[string]string) (fileName, tempPath string, header *http.Header, err error)
- func GetDomainFromURL(url string) (domain string)
- func GetFileNameFromURL(url string) (wholeName, fileName string, fileType string)
- func GetJson(r *http.Request, target interface{}) error
- func GetParsedURL(apiURL string, params map[string]interface{}) (string, error)
- func GetRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
- func GetValidatedJson(r *http.Request, target interface{}) error
- func MyRequest(params *networkStruct.MyRequestParams) (resData *networkStruct.MyRequestResp, err error)
- func ParamsInvalid(w http.ResponseWriter, err error)
- func PostJsonRequest(apiURL string, params map[string]interface{}) ([]byte, error)
- func PostRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
- func RequestJson(method networkStruct.Method, targetURL string, params map[string]interface{}, ...) (map[string]interface{}, *http.Header, int, error)
- func RequestJsonTest(method networkStruct.Method, targetURL string, params map[string]interface{}, ...) (map[string]interface{}, *http.Header, int, error)
- func RequestJsonWithStruct(method networkStruct.Method, targetURL string, params interface{}, ...) (interface{}, *http.Header, int, error)
- func RequestRaw(method networkStruct.Method, targetURL string, params map[string]interface{}, ...) (string, *http.Header, int, error)
- func RequestRawTest(method networkStruct.Method, targetURL string, params map[string]interface{}, ...) (string, *http.Header, int, error)
- func RequestWithStruct(method networkStruct.Method, contentType networkStruct.ContentType, ...) (interface{}, *http.Header, int, error)
- func RequestWithStructTest(method networkStruct.Method, contentType networkStruct.ContentType, ...) (interface{}, *http.Header, int, error)
- func ReturnError(w http.ResponseWriter, msg string)
- func ReturnResult(w http.ResponseWriter, message string, data interface{}, statusCode int)
- func SendRequest(method networkStruct.Method, contentType networkStruct.ContentType, ...) ([]byte, *http.Header, int, error)
- func SetRouterFlag(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMixedRouter ¶ added in v1.5.6
func CheckMixedRouter(requestRouterFlag string, requestRouterKey int, next http.Handler) http.Handler
CheckMixedRouter 检查混合项目的路由准入
func CheckMixedRouterWithHandler ¶ added in v1.5.6
func CheckMixedRouterWithHandler(requestRouterFlag string, handler func(r *http.Request, routerFlag string, routerKeys []int) error, next http.Handler) http.Handler
CheckMixedRouterWithHandler 检查混合项目的路由准入(自定义方法)
func DownloadFileWithFormat ¶ added in v1.5.6
func DownloadFileWithFormat(targetURL, localPath, format string, headers map[string]string) (fileName, tempPath string, header *http.Header, err error)
*
- @func: DownloadFileWithFormat 下载目标文件到本地,强制命名格式
- @author: Wiidz
- @date: 2021-6-20
func GetDomainFromURL ¶ added in v1.5.6
GetDomainFromURL 从url中提取文件名
func GetFileNameFromURL ¶ added in v1.5.6
GetFileNameFromURL 从url中提取文件名
func GetRequest ¶
func GetRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
*
- @func: GetRequest 发送get请求
- @author: Wiidz
- @date: 2021-06-20
func GetValidatedJson ¶ added in v1.5.6
GetValidatedJson 获取通过validatMng验证过的json数据
func MyRequest ¶ added in v1.5.6
func MyRequest(params *networkStruct.MyRequestParams) (resData *networkStruct.MyRequestResp, err error)
MyRequest 自定义请求
func ParamsInvalid ¶ added in v1.5.6
func ParamsInvalid(w http.ResponseWriter, err error)
ParamsInvalid json格式返回参数错误
func PostRequest ¶
func PostRequest(apiURL string, params map[string]interface{}) (map[string]interface{}, *http.Header, error)
*
- @func: PostRequest 发送post请求
- @author: Wiidz
- @date: 2021-6-20
func RequestJson ¶ added in v1.5.6
func RequestJsonTest ¶ added in v1.5.6
func RequestJsonWithStruct ¶ added in v1.5.6
func RequestRaw ¶ added in v1.5.6
func RequestRawTest ¶ added in v1.5.6
func RequestWithStruct ¶ added in v1.5.6
func RequestWithStruct(method networkStruct.Method, contentType networkStruct.ContentType, targetURL string, params map[string]interface{}, headers map[string]string, iStruct interface{}) (interface{}, *http.Header, int, error)
func RequestWithStructTest ¶ added in v1.5.6
func RequestWithStructTest(method networkStruct.Method, contentType networkStruct.ContentType, targetURL string, params map[string]interface{}, headers map[string]string, iStruct interface{}) (interface{}, *http.Header, int, error)
func ReturnError ¶ added in v1.5.6
func ReturnError(w http.ResponseWriter, msg string)
*
- @func: ReturnResult json格式返回
- @author Wiidz
- @date 2019-11-16
func ReturnResult ¶ added in v1.5.6
func ReturnResult(w http.ResponseWriter, message string, data interface{}, statusCode int)
func SendRequest ¶ added in v1.5.35
func SendRequest(method networkStruct.Method, contentType networkStruct.ContentType, targetURL string, params map[string]interface{}, headers map[string]string) ([]byte, *http.Header, int, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.