Documentation
¶
Index ¶
- Constants
- func NewClient(apiKey, apiSecret string) (c *client)
- func NewClientWithCustomHttpConfig(apiKey, apiSecret string, httpClient *http.Client) (c *client)
- func NewClientWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) (c *client)
- type Bool
- type Currency
- type FixedFloat
- type Integer
- type Rate
Constants ¶
const (
ApiBase = "https://ff.io/api/v2" // FixedFloat API endpoint
)
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(apiKey, apiSecret string) (c *client)
NewClient return a new FixedFloat HTTP client
func NewClientWithCustomHttpConfig ¶
NewClientWithCustomHttpConfig returns a new FixedFloat HTTP client using the predefined http client
func NewClientWithCustomTimeout ¶
NewClient returns a new FixedFloat HTTP client with custom timeout
Types ¶
type FixedFloat ¶
type FixedFloat struct {
// contains filtered or unexported fields
}
FixedFloat represent a FixedFloat client
func New ¶
func New(apiKey, apiSecret string) *FixedFloat
New returns an instantiated FixedFloat struct
func NewWithCustomHttpClient ¶
func NewWithCustomHttpClient(apiKey, apiSecret string, httpClient *http.Client) *FixedFloat
NewWithCustomHttpClient returns an instantiated FixedFloat struct with custom http client
func NewWithCustomTimeout ¶
func NewWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) *FixedFloat
NewWithCustomTimeout returns an instantiated FixedFloat struct with custom timeout
func (*FixedFloat) GetCurrencies ¶
func (ff *FixedFloat) GetCurrencies() (currencies []Currency, err error)
GetCurrencies getting a list of currencies supported by the FixedFloat service
func (*FixedFloat) GetRate ¶
func (ff *FixedFloat) GetRate(fromCurrency string, toCurrency string, amount float64) (Rate, Rate, error)
GetRate getting the exchange rate of a pair of currencies in the selected direction and type of rate.
func (*FixedFloat) SetDebug ¶
func (ff *FixedFloat) SetDebug(enable bool)
SetDebug set enable/disable http request/response dump
type Rate ¶
type Rate struct { Code string `json:"code"` Coin string `json:"coin"` Network string `json:"network"` Amount float64 `json:"amount,string"` Rate float64 `json:"rate,string"` Precision uint8 `json:"precision"` Min float64 `json:"min,string"` Max float64 `json:"max,string"` Usd float64 `json:"usd,string"` }