Documentation ¶
Index ¶
- func ClientIP(cip string) (ip string)
- func DeepCopy(value interface{}) interface{}
- func DrainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err error)
- func ExecShell(name string, arg ...string) ([]byte, error)
- func FileIsExist(path string) bool
- func GetIPByPconline(ip string) string
- func Graceful(srv *http.Server, zl *zap.Logger, timeout time.Duration)
- func HttpRequestWithSign(url string, data map[string]interface{}, params ...interface{}) string
- func InArray(needle interface{}, haystack interface{}) bool
- func MD5(str string) string
- func NewGoCurl() *goCurl
- func NewSafeGo() *panicGroup
- func Nl2br(str string, isXhtml bool) string
- func NowMemStats() string
- func PhpSerialize(vars map[string]interface{}) (str string)
- func PhpUnserialize(str string) map[string]interface{}
- func PublicIP() (ip string)
- func PushContextMessage(ctx *gin.Context, msg string, reqStr string, stack string, isAtAll bool)
- func PushSimpleMessage(msg string, isAtAll bool)
- func RandFloat64(min, max float64, decimalNum int) float64
- func RandIntn(max int) int
- func SafeCloseChan(ch chan interface{}) (closed bool)
- func SafeDefer(params ...interface{})
- func SafeGo(params ...interface{})
- func SafeSendChan(ch chan<- interface{}, value interface{}) (closed bool)
- func SortMapByKey(mp map[string]interface{}) string
- func StrFirstToLower(str string) string
- func StrFirstToUpper(str string) string
- func Struct2Map(obj interface{}) map[string]interface{}
- func SystemIP() string
- type Request
- func (r *Request) Get() (*Response, error)
- func (r *Request) Post() (*Response, error)
- func (r *Request) Send() (*Response, error)
- func (r *Request) SetBody(body io.Reader) *Request
- func (r *Request) SetCookies(cookies map[string]string) *Request
- func (r *Request) SetHeaders(headers map[string]string) *Request
- func (r *Request) SetMethod(method string) *Request
- func (r *Request) SetPostData(postData map[string]interface{}) *Request
- func (r *Request) SetQueries(queries map[string]string) *Request
- func (r *Request) SetTimeOut(timeout time.Duration) *Request
- func (r *Request) SetUrl(url string) *Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpRequestWithSign ¶
带签名http请求
func InArray ¶
func InArray(needle interface{}, haystack interface{}) bool
InArray in_array() haystack supported types: slice, array or map
func PushContextMessage ¶
PushContextMessage
func RandFloat64 ¶
RandFloat64 区间范围内获取随机数 min 最小值 max float64 最大值 decimalNum int 返回几位小数点
func SafeSendChan ¶
func SafeSendChan(ch chan<- interface{}, value interface{}) (closed bool)
SafeSendChan
Types ¶
type Request ¶
type Request struct { Method string Url string Timeout time.Duration Headers map[string]string Cookies map[string]string Queries map[string]string PostData map[string]interface{} Body io.Reader // contains filtered or unexported fields }
Request构造类
func (*Request) SetCookies ¶
设置请求cookies
func (*Request) SetPostData ¶
设置post请求的提交数据
func (*Request) SetQueries ¶
设置url查询参数
func (*Request) SetTimeOut ¶
SetDialTimeOut
Click to show internal directories.
Click to hide internal directories.