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 Debugf(format string, v ...interface{})
- func DecimalToBigInt(d decimal.Decimal) *big.Int
- func Errorf(format string, v ...interface{})
- func Hex2BigInt(str string) *big.Int
- func Hex2Bytes(str string) []byte
- func Hex2Int(hex string) uint64
- func Infof(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 ¶
func StartMetrics()
func String2BigInt ¶
func ToJsonString ¶
func ToJsonString(o interface{}) string
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(transport *http.Transport) *HttpClient
type IHttpClient ¶
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 ¶
type MetricsHandler struct { }
func (MetricsHandler) ServeHTTP ¶
func (MetricsHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.