Documentation
¶
Index ¶
- func HttpGet(url string) (resp *http.Response, err error)
- func HttpGetWithCookie(url string, cookies ...*http.Cookie) (resp *http.Response, err error)
- func HttpPost(url string, data url.Values) (resp *http.Response, err error)
- func HttpPostFileChunkWithCookie(url string, fieldName string, fileName string, data url.Values, chunk []byte, ...) (resp *http.Response, err error)
- func HttpPostFileWithCookie(url string, fieldName, fileName string, data url.Values, ...) (resp *http.Response, err error)
- func HttpPostWithCookie(url string, data url.Values, cookies ...*http.Cookie) (resp *http.Response, err error)
- func HttpPostWithoutRedirect(url string, data url.Values) (resp *http.Response, err error)
- func Int64(v string) (int64, error)
- func IsEmpty(s string) bool
- func IsWindows() bool
- func MD5(s string) (hash string)
- func MD5FromFile(file io.Reader) (hash string, err error)
- func MD5FromFileName(path string) (hash string, err error)
- func Marshal(v interface{}) ([]byte, error)
- func RandomString(length int) (s string)
- func String(v interface{}) string
- func Unmarshal(data []byte, v interface{}) error
- type ToString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpGetWithCookie ¶
HttpGetWithCookie get http resource with cookies
func HttpPostFileChunkWithCookie ¶ added in v0.3.2
func HttpPostFileChunkWithCookie(url string, fieldName string, fileName string, data url.Values, chunk []byte, offset int64, cookies ...*http.Cookie) (resp *http.Response, err error)
HttpPostFileChunkWithCookie send a post request with form data, a file chunk and cookies
func HttpPostFileWithCookie ¶ added in v0.3.0
func HttpPostFileWithCookie(url string, fieldName, fileName string, data url.Values, cookies ...*http.Cookie) (resp *http.Response, err error)
HttpPostFileWithCookie send a post request with form data, file and cookies
func HttpPostWithCookie ¶ added in v0.3.0
func HttpPostWithCookie(url string, data url.Values, cookies ...*http.Cookie) (resp *http.Response, err error)
HttpPostWithCookie send a post request with form data and cookies
func HttpPostWithoutRedirect ¶
HttpPostWithoutRedirect send a post request with form data and not auto redirect
func MD5FromFile ¶
MD5FromFile calculate the hash value of the file If you reuse the file reader, please set its offset to start position first, like os.File.Seek
func MD5FromFileName ¶
MD5FromFileName calculate the hash value of the file
func RandomString ¶
RandomString generate a random string, max length is 20
Types ¶
Click to show internal directories.
Click to hide internal directories.