Documentation ¶
Index ¶
- Variables
- type Balance
- type CustomPeriod
- type Market
- type MarketBalance
- type MarketBalanceService
- type MarketPrice
- type MarketPriceService
- type MarketProvider
- type MarketService
- type MarketsBalances
- type MarketsLoaderService
- type MarketsPrices
- type Page
- type PredefinedPeriod
- type Price
- type TimeRange
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidTimeFormat = errors.New("fromTime must be valid RFC3339 format")
)
Functions ¶
This section is empty.
Types ¶
type CustomPeriod ¶
type MarketBalance ¶
type MarketBalanceService ¶
type MarketBalanceService interface { // InsertBalance inserts market balance in current moment InsertBalance( ctx context.Context, marketBalance MarketBalance, ) error // GetBalances returns all markets balances from time in past equal to passed arg fromTime //if marketID is passed method will return data for all market's, otherwise only for provided one GetBalances( ctx context.Context, timeRange TimeRange, page Page, marketIDs ...string, ) (*MarketsBalances, error) // StartFetchingBalancesJob starts cron job that will periodically fetch and store balances for all markets StartFetchingBalancesJob() error }
func NewMarketBalanceService ¶
func NewMarketBalanceService( marketBalanceRepository domain.MarketBalanceRepository, marketRepository domain.MarketRepository, tdexMarketLoaderSvc tdexmarketloader.Service, jobPeriodInMinutes string, ) MarketBalanceService
type MarketPrice ¶
type MarketPriceService ¶
type MarketPriceService interface { // InsertPrice inserts market price in current moment InsertPrice( ctx context.Context, marketPrice MarketPrice, ) error // GetPrices returns all markets prices from time in past equal to passed arg fromTime //if marketID is passed method will return data for all market's, otherwise only for provided one GetPrices( ctx context.Context, timeRange TimeRange, page Page, referenceCurrency string, marketIDs ...string, ) (*MarketsPrices, error) // StartFetchingPricesJob starts cron job that will periodically fetch and store prices for all markets StartFetchingPricesJob() error }
func NewMarketPriceService ¶
func NewMarketPriceService( marketPriceRepository domain.MarketPriceRepository, marketRepository domain.MarketRepository, tdexMarketLoaderSvc tdexmarketloader.Service, jobPeriodInMinutes string, raterSvc port.RateService, ) MarketPriceService
type MarketProvider ¶
type MarketService ¶
type MarketService interface { ListMarkets( ctx context.Context, req []MarketProvider, page Page, ) ([]Market, error) }
func NewMarketService ¶
func NewMarketService( marketRepository domain.MarketRepository, ) MarketService
type MarketsBalances ¶
type MarketsLoaderService ¶
type MarketsLoaderService interface {
StartFetchingMarketsJob() error
}
func NewMarketsLoaderService ¶
func NewMarketsLoaderService( marketRepository domain.MarketRepository, tdexMarketLoaderSvc tdexmarketloader.Service, ) MarketsLoaderService
type MarketsPrices ¶
type PredefinedPeriod ¶
type PredefinedPeriod int
const ( // NIL is added in proto file to recognised when predefined period is passed NIL PredefinedPeriod = iota LastHour LastDay LastMonth LastThreeMonths YearToDate All StartYear = 2022 )
type TimeRange ¶
type TimeRange struct { PredefinedPeriod *PredefinedPeriod CustomPeriod *CustomPeriod }
Click to show internal directories.
Click to hide internal directories.