tools

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 9 Imported by: 44

README

tools

go的工具集

Documentation

Index

Constants

View Source
const HttpTimeOut = 10 * time.Second

超时时间

Variables

This section is empty.

Functions

func DeleteFile

func DeleteFile(path string)

func DownloadFile

func DownloadFile(url string, path string)

func GetSetHeaderWithString

func GetSetHeaderWithString(url string, header map[string]string) (string, error)

* header["Accept-Encoding"]="gzip, deflate, br"

func GetWithBody

func GetWithBody(url string) (io.ReadCloser, error)

注意要手动关闭body

func GetWithString

func GetWithString(url string) (string, error)

get获取字符串结果

func Query

func Query(url string, method string, parameter string, header map[string]string) (*http.Response, error)

请求底层函数

func ReadFile

func ReadFile(path string) (string, error)

读取文件

func WriteLine

func WriteLine(path string, data string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL