utils

package
v0.0.0-...-db5ea55 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigOutboundIP

func DigOutboundIP() (string, error)

func GetCommonDataFromJSON

func GetCommonDataFromJSON(datapath string)

func GetExternalIP

func GetExternalIP() string

func GetInternalIP

func GetInternalIP() (string, error)

func GetOutboundIP

func GetOutboundIP() (net.IP, error)

func HttpGetRequest

func HttpGetRequest(httpGet *HttpGet) error

func HttpPostRequest

func HttpPostRequest(httpPost *HttpPost) error

func Map2UrlQuery

func Map2UrlQuery(mapParams map[string]string) string

将map格式的请求参数转换为字符串格式的 mapParams: map格式的参数键值对 return: 查询字符串

func Map2UrlQueryInterface

func Map2UrlQueryInterface(mapParams map[string]interface{}) string

func Map2UrlQueryUrl

func Map2UrlQueryUrl(mapParams map[string]string) string

func SaveFile

func SaveFile(path, str string) error

func WebOutboundIP

func WebOutboundIP() string

Types

type CommonData

type CommonData struct {
	Coins []*coin.Coin `json: "coins"`
	Pairs []*pair.Pair `json: "pairs"`
}

type ExchangeData

type ExchangeData struct {
	CoinConstraint cmap.ConcurrentMap
	PairConstraint cmap.ConcurrentMap
}

func GetExchangeDataFromJSON

func GetExchangeDataFromJSON(datapath string, exName exchange.ExchangeName) *ExchangeData

type HttpGet

type HttpGet struct {
	URI     string `json:"uri"`
	Proxy   string `json:"proxy"`
	Timeout int    `json:"timeout"`

	//Reference....
	Request  *http.Request
	Response *http.Response

	//Output
	DebugMode    bool `json:"debug mode"`
	ResponseBody []byte
	StatusCode   int
	Error        error
}

type HttpPost

type HttpPost struct {
	URI         string `json:"uri"`
	RequestBody []byte `json:"body"`
	Proxy       string `json:"proxy"`
	Timeout     int    `json:"timeout"`

	//Reference....
	Request  *http.Request
	Response *http.Response

	//Output
	ResponseBody []byte
	StatusCode   int
	DebugMode    bool `json:"debug mode"`
	Error        error
}

type JsonData

type JsonData struct {
	CoinConstraint []*exchange.CoinConstraint `json: "coinconstraint"`
	PairConstraint []*exchange.PairConstraint `json: "pairconstraint"`
}

type OSType

type OSType string
const (
	Windows OSType = "windows"
	Linux   OSType = "linux"
)

func GetOS

func GetOS() OSType

Jump to

Keyboard shortcuts

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