Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvanceTradeAPIEndpoint ¶
type AuthTransport ¶
type AuthTransport struct { Base http.RoundTripper JWT string }
AuthTransport is a transport that adds an Authorization header to the request.
type Options ¶
type Options struct { AdvanceTradeAPIEndpoint *AdvanceTradeAPIEndpoint Logger *slog.Logger JWT string // it's almost useless to set JWT at this level, but keeping this for backward compatibility }
func (Options) NewTransport ¶
func (o Options) NewTransport() (http.RoundTripper, error)
type RESTClient ¶
type RESTClient struct { HttpClient *http.Client Logger *slog.Logger AdvanceTradeAPIEndpoint *AdvanceTradeAPIEndpoint }
RESTClient represents a client for making HTTP requests.
func (*RESTClient) DoRequest ¶
func (c *RESTClient) DoRequest(ctx context.Context, method, url string, query urlpkg.Values, result, reqBody interface{}) error
DoRequest sends an HTTP request and processes the response. it is pretty dumb in the sense, it doesn't automatically verify the url endpoints e.g. websocket or REST
type WebSocketClient ¶
type WebSocketClient struct { Connection *websocket.Conn Logger *slog.Logger AdvanceTradeAPIEndpoint *AdvanceTradeAPIEndpoint }
WebSocketClient represents a client for making HTTP requests.
func (*WebSocketClient) SetConnection ¶
func (w *WebSocketClient) SetConnection(baseUrl string) error
Click to show internal directories.
Click to hide internal directories.