utils

package
Version: v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTransport *http.Transport
)

Functions

func CloneDefaultTransport

func CloneDefaultTransport() *http.Transport

func DefaultHttpClient

func DefaultHttpClient(proxyURL string) *http.Client

func GetParamHmacSHA256Base64Sign

func GetParamHmacSHA256Base64Sign(secret, params string) (string, error)

func GzipCompress

func GzipCompress(in []byte) ([]byte, error)

GzipCompress gzip 压缩

func GzipUncompress

func GzipUncompress(in []byte) ([]byte, error)

GzipUncompress gzip 解压

func HttpGet

func HttpGet(client *http.Client, reqUrl string, postData string, headers map[string]string) ([]byte, error)

func HttpPost

func HttpPost(client *http.Client, reqUrl string, postData string, headers map[string]string) ([]byte, error)

func NewHttpRequest

func NewHttpRequest(client *http.Client, method string, reqUrl string, postData string, requestHeaders map[string]string) ([]byte, error)

func ParseProxy

func ParseProxy(proxyURL string) (res func(*http.Request) (*url.URL, error), err error)

"socks5://127.0.0.1:1080"

func SetLevel

func SetLevel(level int)

SetLevel 设置压缩级别

func ValuesToJson

func ValuesToJson(v url.Values) ([]byte, error)

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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