Documentation ¶
Overview ¶
Index ¶
- Constants
- Variables
- func Base64Decode(str string) (string, error)
- func Base64Encode(str string) string
- func ExternalIP() (net.IP, error)
- func FetchFiles(client *http.Client, files []RawFile, header http.Header) error
- func FetchFilesCurl(files []RawFile, curlOptions ...string) error
- func GetOnline() ([]byte, error)
- func HttpCall(client *http.Client, method, url string, header http.Header, body io.Reader) (io.ReadCloser, error)
- func HttpGet(client *http.Client, url string, header http.Header) (io.ReadCloser, error)
- func HttpGetBytes(client *http.Client, url string, header http.Header) ([]byte, error)
- func HttpGetJSON(client *http.Client, url string, v interface{}) error
- func HttpGetToFile(client *http.Client, url string, header http.Header, fileName string) error
- func HttpPost(client *http.Client, url string, header http.Header, body []byte) (io.ReadCloser, error)
- func HttpPostJSON(client *http.Client, url string, body, v interface{}) error
- func UrlDecode(str string) (string, error)
- func UrlEncode(str string) string
- type NotFoundError
- type QQwry
- type RawFile
- type RemoteError
Constants ¶
const ( INDEX_LEN = 7 // INDEX_LEN 索引长度 REDIRECT_MODE_1 = 0x01 // REDIRECT_MODE_1 国家的类型, 指向另一个指向 REDIRECT_MODE_2 = 0x02 // REDIRECT_MODE_2 国家的类型, 指向一个指向 )
Variables ¶
var UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1541.0 Safari/537.36"
Functions ¶
func ExternalIP ¶
func FetchFiles ¶
FetchFiles fetches files specified by the rawURL field in parallel.
func FetchFilesCurl ¶
FetchFilesCurl uses command `curl` to fetch files specified by the rawURL field in parallel.
func HttpCall ¶
func HttpCall(client *http.Client, method, url string, header http.Header, body io.Reader) (io.ReadCloser, error)
HttpCall makes HTTP method call.
func HttpGet ¶
HttpGet gets the specified resource. ErrNotFound is returned if the server responds with status 404.
func HttpGetBytes ¶
HttpGetBytes gets the specified resource. ErrNotFound is returned if the server responds with status 404.
func HttpGetJSON ¶
HttpGetJSON gets the specified resource and mapping to struct. ErrNotFound is returned if the server responds with status 404.
func HttpGetToFile ¶
HttpGetToFile gets the specified resource and writes to file. ErrNotFound is returned if the server responds with status 404.
func HttpPost ¶
func HttpPost(client *http.Client, url string, header http.Header, body []byte) (io.ReadCloser, error)
HttpPost posts the specified resource. ErrNotFound is returned if the server responds with status 404.
func HttpPostJSON ¶
HttpPostJSON posts the specified resource with struct values, and maps results to struct. ErrNotFound is returned if the server responds with status 404.
Types ¶
type NotFoundError ¶
type NotFoundError struct {
Message string
}
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type QQwry ¶
type QQwry struct { Ip string Lng float64 Lat float64 Address string Ips string FileData []byte NumIp int64 Offset int64 Enc mahonia.Decoder // contains filtered or unexported fields }
type RemoteError ¶
func (*RemoteError) Error ¶
func (e *RemoteError) Error() string