util

package
v0.0.0-...-fc85a51 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes2RSAPrivateKey

func Bytes2RSAPrivateKey(priKey []byte) *rsa.PrivateKey

func Bytes2RSAPublicKey

func Bytes2RSAPublicKey(pubKey []byte) *rsa.PublicKey

func LocalIP

func LocalIP() string

LocalIP 获取机器的IP

func MapStringToStruct

func MapStringToStruct(m map[string]string, i interface{}) error

func RandomStr

func RandomStr() string

RandomStr 获取一个随机字符串

func XmlToMap

func XmlToMap(xmlData []byte) (map[string]string, error)

Types

type HttpClient

type HttpClient struct {
	Debug       bool
	HttpRequest *http.Request
}

func InitHttpClient

func InitHttpClient() *HttpClient

func (*HttpClient) Delete

func (hc *HttpClient) Delete(url string, paramData map[string]interface{}, headerParam map[string]string) ([]byte, error)

func (*HttpClient) Get

func (hc *HttpClient) Get(url string, paramData map[string]interface{}, headerParam map[string]string) (interface{}, error)

func (*HttpClient) Post

func (hc *HttpClient) Post(url string, paramData map[string]interface{}, headerParam map[string]string) (interface{}, error)

func (*HttpClient) PostBodyJson

func (hc *HttpClient) PostBodyJson(url string, body interface{}) (interface{}, error)

func (*HttpClient) PostBodyJsonWithHeader

func (hc *HttpClient) PostBodyJsonWithHeader(url string, body interface{}) (interface{}, error)

func (*HttpClient) PostBodyXml

func (hc *HttpClient) PostBodyXml(url string, body interface{}) ([]byte, error)

func (*HttpClient) Put

func (hc *HttpClient) Put(url string, paramData map[string]interface{}, headerParam map[string]string) (interface{}, error)

type LogClient

type LogClient struct {
}

func InitLogClient

func InitLogClient() *LogClient

func (*LogClient) Write

func (lc *LogClient) Write(message interface{})

记录日志

Jump to

Keyboard shortcuts

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