Documentation ¶
Index ¶
- Constants
- func BigToHex(bigInt big.Int) string
- func Bytes2BigInt(bytes []byte) *big.Int
- func Bytes2Hex(bytes []byte) string
- func Bytes2HexP(bytes []byte) string
- func Debug(format string, v ...interface{})
- func DecimalToBigInt(d decimal.Decimal) *big.Int
- func Error(format string, v ...interface{})
- func Hex2BigInt(str string) *big.Int
- func Hex2Bytes(str string) []byte
- func Hex2Int(hex string) uint64
- func Info(format string, v ...interface{})
- func Int2Bytes(i uint64) []byte
- func Int2Hex(number uint64) string
- func IntToDecimal(value interface{}) decimal.Decimal
- func IntToHex(i int) string
- func LeftPadBytes(slice []byte, l int) []byte
- func NumberToString(number interface{}) string
- func ParseInt(number string, defaultNumber int) int
- func RightPadBytes(slice []byte, l int) []byte
- func StartMetrics()
- func String2BigInt(str string) big.Int
- func StringToDecimal(str string) decimal.Decimal
- func ToJsonString(o interface{}) string
- type HttpClient
- func (h *HttpClient) Delete(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *HttpClient) Get(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *HttpClient) Post(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *HttpClient) Put(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *HttpClient) Request(method, u string, params []KeyValue, requestBody interface{}, ...) (err error, code int, respBody []byte)
- type IHttpClient
- type KeyValue
- type MetricsHandler
Constants ¶
View Source
const DefaultMetricPath = "/metrics"
View Source
const DefaultMetricPort = "3006"
View Source
const ErrorCode = -1
Variables ¶
This section is empty.
Functions ¶
func Bytes2BigInt ¶
func Hex2BigInt ¶
func IntToDecimal ¶
func LeftPadBytes ¶
LeftPadBytes zero-pads slice to the left up to length l.
func NumberToString ¶
func NumberToString(number interface{}) string
func RightPadBytes ¶
RightPadBytes zero-pads slice to the right up to length l.
func StartMetrics ¶ added in v0.0.5
func StartMetrics()
func String2BigInt ¶ added in v0.0.3
func ToJsonString ¶
func ToJsonString(o interface{}) string
Types ¶
type HttpClient ¶ added in v0.0.3
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶ added in v0.0.3
func NewHttpClient(transport *http.Transport) *HttpClient
type IHttpClient ¶ added in v0.0.3
type IHttpClient interface { Request(method, url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Get(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Post(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Delete(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Put(url string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) }
type MetricsHandler ¶ added in v0.0.5
type MetricsHandler struct { }
func (MetricsHandler) ServeHTTP ¶ added in v0.0.5
func (MetricsHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.