Documentation
¶
Index ¶
- func ClientIP(r *http.Request) string
- func GetResponseBodyFormUrl(method, reqUrl string, customHeader map[string]string, reqBody io.Reader, ...) ([]byte, error)
- func HttpProxyClient() *http.Client
- func JsonUnmarshalByJsonFile(jsonPath string, v any) error
- func JsonUnmarshalByURL(method, reqUrl string, customHeader map[string]string, reqBody io.Reader, ...) error
- func RemoteIP(r *http.Request) string
- func UniqueSlice[T string | ~int](repeatedSlice []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientIP ¶
ClientIP 尽最大努力实现获取客户端 IP 的算法。 解析 X-Real-IP 和 X-Forwarded-For 以便于反向代理(nginx 或 haproxy)可以正常工作。
func GetResponseBodyFormUrl ¶
func HttpProxyClient ¶
func JsonUnmarshalByJsonFile ¶
JsonUnmarshalByJsonFile 从JSON文件中反序列化JSON数据
func JsonUnmarshalByURL ¶
func JsonUnmarshalByURL(method, reqUrl string, customHeader map[string]string, reqBody io.Reader, useProxy bool, v any) error
JsonUnmarshalByURL 从URL请求中反序列化JSON数据
func UniqueSlice ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.