apirequests

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRequestSignature

func BuildRequestSignature(requestMethod, requestPath string, requestBody []byte) (string, string)

BuildRequestSignature builds the signature required by the Coinbase Pro API for the CB-ACCESS-SIGN header, using the request's method, path, and JSON body (if provided). The generated signature, as well as the timestamp (in seconds) used for the signature (for use with the CB-ACCESS-TIMESTAMP header) are returned.

func DELETERequest

func DELETERequest(endpoint string, params RequestParams) ([]byte, error)

DELETERequest fires off a DELETE request to the specified endpoint.

func GETRequest

func GETRequest(endpoint string, params RequestParams) ([]byte, error)

func POSTRequest

func POSTRequest(endpoint string, body interface{}, params RequestParams) ([]byte, error)

POSTRequest fires off a POST request to the specified endpoint. If body is non-nil, it is added to the request.

Types

type RequestParams

type RequestParams interface {
	GetEncoded() string
}

type ResponseWithMessage

type ResponseWithMessage struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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