toolbox

package
v0.0.0-...-8185413 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const RECV_WINDOW int64 = 0

Variables

This section is empty.

Functions

func GenerateHash

func GenerateHash(key, query string) hash.Hash

Returns SHA256 HMAC hash needed for sending requests

func GenerateQuery

func GenerateQuery(secretkey string, recvWindow int64, m map[string]string) string

Generates an unsorted query from a string[string] map, includes receive window, current timestamp and a signature from the included secret key.

func GetTime

func GetTime() int64

Return time in ms

Types

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

func New

func New(url, apikey, secretkey string) *HTTPClient

func (*HTTPClient) Request

func (c *HTTPClient) Request(method, endpoint string, payload map[string]string) (*http.Response, error)

Handle API requests. Takes in the method and endpoint as strings and a map of querys to send

type NotImplementedError

type NotImplementedError struct {
	// contains filtered or unexported fields
}

func (*NotImplementedError) Error

func (e *NotImplementedError) Error() string

Jump to

Keyboard shortcuts

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