utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(n int) []byte

Bytes generates n random bytes

func GetCurrTime

func GetCurrTime() int

GetCurrTime get current timestamp

func GetMD5String

func GetMD5String(strings string) string

GetMD5String md5 string

func HTTPQueryBuild

func HTTPQueryBuild(params map[string]string) string

HTTPQueryBuild ...

func Hex

func Hex(n int) string

Hex ...

func Md5ByByte

func Md5ByByte(bytes []byte) string

Md5ByByte md5 by byte

Types

type HTTPClient

type HTTPClient struct {
	Client   *http.Client
	Response *http.Response
}

HTTPClient ...

func (*HTTPClient) GetResponseByte

func (c *HTTPClient) GetResponseByte() (body []byte, err error)

GetResponseByte ...

func (*HTTPClient) GetResponseJSON

func (c *HTTPClient) GetResponseJSON(response interface{}, errorResponse interface{}) error

GetResponseJSON ...

func (*HTTPClient) HTTPGet

func (c *HTTPClient) HTTPGet(url string, params map[string]string) (err error)

HTTPGet ...

func (*HTTPClient) HTTPPost

func (c *HTTPClient) HTTPPost(url string, params map[string]string) error

HTTPPost ...

func (*HTTPClient) HTTPPostJSON

func (c *HTTPClient) HTTPPostJSON(url, jsonStr string) error

HTTPPostJSON ...

Jump to

Keyboard shortcuts

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