Documentation ¶
Index ¶
- Constants
- func ClientIP(r *http.Request, debug ...bool) string
- func ClientPublicIP(r *http.Request, debug ...bool) string
- func HasLocalIP(ip net.IP) bool
- func HasLocalIPAddr(ip string) bool
- func Request(method string, remoteUrl string, params url.Values, headers map[string]string, ...) (resp *http.Response, err error)
- func RequestJson(v interface{}, method string, remoteUrl string, params url.Values, ...) error
- type Paginator
- func (p *Paginator) GetCurrentPage() int
- func (p *Paginator) GetPageNums() int
- func (p *Paginator) GetPages() []int
- func (p *Paginator) GetTotal() int64
- func (p *Paginator) HasNext() bool
- func (p *Paginator) HasPages() bool
- func (p *Paginator) HasPrev() bool
- func (p *Paginator) IsActive(page int) bool
- func (p *Paginator) Offset() int
- func (p *Paginator) PageLink(page int) string
- func (p *Paginator) PageLinkFirst() (link string)
- func (p *Paginator) PageLinkLast() (link string)
- func (p *Paginator) PageLinkNext() (link string)
- func (p *Paginator) PageLinkPrev() (link string)
- func (p *Paginator) SetTotal(total interface{})
- type UtilHttp
- func (uh *UtilHttp) AddHeader(k string, v string) *UtilHttp
- func (uh *UtilHttp) BasicAuth(user string, password string) *UtilHttp
- func (uh *UtilHttp) BuildRemoteUrl(method string, path string, params *url.Values) (remoteUrl string, err error)
- func (uh *UtilHttp) GetLastRespStatusCode() int
- func (uh *UtilHttp) PostFile(path string, filedName string, file string, params url.Values, ...) (resp *http.Response, err error)
- func (uh *UtilHttp) PostFileJson(v interface{}, path string, filedName string, file string, params url.Values, ...) error
- func (uh *UtilHttp) PostFilePlain(path string, filedName string, file string, params url.Values, ...) (body []byte, err error)
- func (uh *UtilHttp) Request(method string, path string, params url.Values, headers map[string]string) (resp *http.Response, err error)
- func (uh *UtilHttp) RequestJson(v interface{}, method string, path string, params url.Values, ...) error
- func (uh *UtilHttp) RequestPlain(method string, path string, params url.Values, headers map[string]string) (body []byte, err error)
- func (uh *UtilHttp) SetBaseUrl(baseUrl string) *UtilHttp
- func (uh *UtilHttp) SetClientCertPemContent(pemContent []byte, key []byte) *UtilHttp
- func (uh *UtilHttp) SetClientCertPemPath(path string) *UtilHttp
- func (uh *UtilHttp) SetSslVerify(v bool) *UtilHttp
- func (uh *UtilHttp) SetTimeout(timeout time.Duration) *UtilHttp
- func (uh *UtilHttp) UseProxySocks5(proxyAddr string, proxyUser string, proxyPassword string) *UtilHttp
Constants ¶
View Source
const PROXY_TYPE_SOCKS5 = "socks5"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Paginator ¶
type Paginator struct { Request *http.Request `json:"-"` PerPage int `json:"per_page"` CurrentPage int `json:"current_page"` MaxPages int `json:"-"` Total int64 `json:"total"` PageRange []int `json:"page_range"` PageNums int `json:"page_nums"` }
func (*Paginator) GetCurrentPage ¶
func (*Paginator) GetPageNums ¶
func (*Paginator) PageLinkFirst ¶
func (*Paginator) PageLinkLast ¶
func (*Paginator) PageLinkNext ¶
func (*Paginator) PageLinkPrev ¶
type UtilHttp ¶
type UtilHttp struct {
// contains filtered or unexported fields
}
func (*UtilHttp) BuildRemoteUrl ¶
func (*UtilHttp) GetLastRespStatusCode ¶
func (*UtilHttp) PostFileJson ¶
func (*UtilHttp) PostFilePlain ¶
func (*UtilHttp) RequestJson ¶
func (*UtilHttp) RequestPlain ¶
func (*UtilHttp) SetBaseUrl ¶
func (*UtilHttp) SetClientCertPemContent ¶
func (*UtilHttp) SetClientCertPemPath ¶
func (*UtilHttp) SetSslVerify ¶
Click to show internal directories.
Click to hide internal directories.