client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend added in v1.1.0

type Backend struct {
	BaseURL string
	APIKey  string
}

LemonClient holding the Base Path of http address as Environment as well as corresponding API Key

func (*Backend) Do added in v1.1.0

func (c *Backend) Do(method string, endpoint string, q interface{}, data []byte) (*Response, error)

Do preforms request towards the backend service. Method as Restful method (GET, POST, etc) Endpoint as where the call should go (OHLC, Account etc) Q as struct holding query- parameters that should be include, eg for filtering Data as request body that should be posted

type LemonError

type LemonError struct {
	Time    time.Time `json:"time"`
	Mode    string    `json:"mode"`
	Status  string    `json:"status"`
	Code    string    `json:"error_code"`
	Message string    `json:"error_message"`
}

LemonError is a type of error parsed from the error- response given during 400- error. Read more at: https://docs.lemon.markets/error-handling

func (LemonError) Error

func (e LemonError) Error() string

Error will return the error- message coming from LemonMarkets backend

type Response

type Response struct {
	Time     time.Time       `json:"time"`
	Status   string          `json:"status"`
	Mode     string          `json:"mode"`
	Previous string          `json:"previous"`
	Next     string          `json:"next"`
	Total    int             `json:"total"`
	Page     int             `json:"page"`
	Pages    int             `json:"pages"`
	Results  json.RawMessage `json:"results"`
}

Reply is basic values that are included from the backend to know if the request is good or not

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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