utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 11 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 GenerateBillNo

func GenerateBillNo() string

GenerateBillNo generate billNo

func GenerateSha256

func GenerateSha256(key, data string) string

GenerateSha256 generate sha256

func GetCurrTime

func GetCurrTime() int

GetCurrTime get expire timestamp

func HTTPQueryBuild

func HTTPQueryBuild(params map[string]string) string

HTTPQueryBuild http_query_build

func Hex

func Hex(n int) string

Hex ...

func QuerySortByKeyStr

func QuerySortByKeyStr(params map[string]string) (str string)

QuerySortByKeyStr query sort by key str2

Types

type HTTPClient

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

HTTPClient http's client

func (*HTTPClient) GetResponseByte

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

GetResponseByte get response byte

func (*HTTPClient) GetResponseJSON

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

GetResponseJSON get response json

func (*HTTPClient) HTTPGet

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

HTTPGet get method

func (*HTTPClient) HTTPPost

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

HTTPPost post string

func (*HTTPClient) HTTPPostJSON

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

HTTPPostJSON post json

Jump to

Keyboard shortcuts

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