client

package
v0.0.0-...-3f65282 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the http client wrapper for Crex24. It handles signing of messages to authentication required routes and the JSON encoding and decoding.

func New

func New(cfg *config.Config) (c *Client)

New creates a new client and returns a pointer.

func (*Client) Get

func (c *Client) Get(path string, params map[string]string, res interface{}, auth bool) (err error)

Get will make a GET request with provided path and params.

func (*Client) Nonce

func (c *Client) Nonce() (n string)

Nonce increments the nonce and sets the header.

func (*Client) Post

func (c *Client) Post(path string, d, res interface{}, auth bool) (err error)

Post will make a POST request.

func (*Client) Sign

func (c *Client) Sign(path, data string) (err error)

Sign adds the authentication information to the header.

func (*Client) URL

func (c *Client) URL() (url string)

URL returns the api host plus version.

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"errorDescription"`
}

ErrorResponse for errors from API.

Jump to

Keyboard shortcuts

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