controllers

package
v0.0.0-...-e9fdc67 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const RatesCacheTimeFrame = 60 * 15 // 15 minutes

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinRate

type CoinRate struct {
	LastUpdated int64
	Rates       map[string]models.RateV2
}

type RateController

type RateController struct {
	RateService *services.RateSevice
	RatesCache  map[string]CoinRate
}

RateController is the main type for serving the API routes.

func (*RateController) GetCoinLiquidity

func (rc *RateController) GetCoinLiquidity(c *gin.Context)

GetCoinLiquidity will return the liquidity available for the selected coin.

func (*RateController) GetCoinRateFromCoinToCoin

func (rc *RateController) GetCoinRateFromCoinToCoin(c *gin.Context)

GetCoinRateFromCoinToCoin will return the rate converting from the first coin to the second coin There is also the option of sending the amount trough a query

func (*RateController) GetCoinRates

func (rc *RateController) GetCoinRates(c *gin.Context)

GetCoinRates will return a rate map based on the selected coin

func (*RateController) GetCoinRatesV2

func (rc *RateController) GetCoinRatesV2(c *gin.Context)

GetCoinRatesV2 GetCoinRates will return a rate map based on the selected coin

func (*RateController) GetCoinToCoinRateWithExchangeMargin

func (rc *RateController) GetCoinToCoinRateWithExchangeMargin(c *gin.Context)

func (*RateController) GetCoinToFIATRate

func (rc *RateController) GetCoinToFIATRate(c *gin.Context)

Returns rate from crypto to specific FIAT currency

func (*RateController) GetNodeProvider

func (rc *RateController) GetNodeProvider(c *gin.Context)

Jump to

Keyboard shortcuts

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