Documentation ¶
Index ¶
- func CacheDataQuery(base_url string, url_data string) (*html.Node, error)
- func CacheQuery(req_url string) (*html.Node, error)
- func CacheQueryOneXpath(req_url string, xpath_str string) *html.Node
- func CacheQueryString(req_url string) (string, error)
- func CacheQueryXml(req_url string) (*xmlquery.Node, error)
- func CacheQueryXpath(req_url string, xpath_str string) []*html.Node
- func GetRequest(req_url string) (io.ReadCloser, error)
- func Hash(url string) string
- func PostRequest(req_url string, url_data string) (io.ReadCloser, error)
- func PreparePath(path string) (string, string)
- func RegisterProxy(addr string, args ...ProxyArgs) (e error)
- func Request(r *http.Request) (*http.Response, error)
- func UrlMerge(base_url string, wd_url string) string
- type Cache
- func (c *Cache) Cache(closer io.ReadCloser, req_url string) (io.ReadCloser, error)
- func (c *Cache) CacheData(closer io.ReadCloser, req_url string, url_data string) (io.ReadCloser, error)
- func (c *Cache) Get(req_url string) (e error)
- func (c *Cache) PrepareDataPath(req_url string, url_data string) string
- func (c *Cache) PrepareGetPath(req_url string) string
- func (c *Cache) Reader(req_url string) (reader io.ReadCloser, e error)
- func (c *Cache) ReaderData(req_url string, url_data string) (reader io.ReadCloser, e error)
- func (c *Cache) Save(req_url string, to string) (written int64, e error)
- type ProxyArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheDataQuery ¶
由编码后的url.Values获取cache
data := url.Values{ "Tid": {"10"}, "wd": {wd}, }
dataStr := data.Encode()
func PostRequest ¶
func PostRequest(req_url string, url_data string) (io.ReadCloser, error)
Generated by curl-to-Go: https://mholt.github.io/curl-to-go
data := url.Values{ "Tid": {"10"}, "wd": {wd}, }
dataStr := data.Encode()
Types ¶
type Cache ¶
type Cache struct {
Tmp string
}
Cache ...
func (*Cache) Cache ¶
func (c *Cache) Cache(closer io.ReadCloser, req_url string) (io.ReadCloser, error)
从URL和http响应内容句柄获得cache文件句柄
func (*Cache) CacheData ¶
func (c *Cache) CacheData(closer io.ReadCloser, req_url string, url_data string) (io.ReadCloser, error)
从Unicode和http响应内容句柄获得cache文件句柄
func (*Cache) PrepareDataPath ¶
为目标路径创建文件夹,返回目标路径的绝对路径,url_data为url.Values的encode()过的形态
func (*Cache) PrepareGetPath ¶
为目标路径创建文件夹,返回目标路径的绝对路径
func (*Cache) Reader ¶
func (c *Cache) Reader(req_url string) (reader io.ReadCloser, e error)
从URL获得cache文件句柄
func (*Cache) ReaderData ¶
从unicode获得cache文件句柄
Click to show internal directories.
Click to hide internal directories.