caches

package
v0.0.0-...-f9f454f Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheRefreshPeriod = int64(3600 * 4)

Refresh cache every 4 hours

Functions

func GetEvaluationConfigTop

func GetEvaluationConfigTop(traderType string, identifier int64) ([]model.Top, bool)

GetEvaluationConfigTop returns the trading mode top from asked cache value and a boolean for value availability

func GetExchangeTop

func GetExchangeTop(traderType string, identifier int64) ([]model.Top, bool)

GetExchangeTop returns the exchange top from asked cache value and a boolean for value availability

func GetPairTop

func GetPairTop(traderType string, identifier int64) ([]model.Top, bool)

GetPairTop returns the exchange top from asked cache value and a boolean for value availability

func GetTradingModeTop

func GetTradingModeTop(traderType string, identifier int64) ([]model.Top, bool)

GetTradingModeTop returns the trading mode top from asked cache value and a boolean for value availability

func GetUpToDateBotCount

func GetUpToDateBotCount(identifier int64, nowTime int64) (int64, bool)

GetBotCount returns the bot count from asked cache value and a boolean for value availability

func SetBotCount

func SetBotCount(identifier int64, count int64, updateTime int64)

SetBotCount sets the cache value for a given time. Resets cache when too many values in it

func SetEvaluationConfigTop

func SetEvaluationConfigTop(traderType string, identifier int64, top []model.Top)

SetEvaluationConfigTop sets the cache value for a given time. Resets cache when too many values in it

func SetExchangeTop

func SetExchangeTop(traderType string, identifier int64, top []model.Top)

SetExchangeTop sets the cache value for a given time. Resets cache when too many values in it

func SetPairTop

func SetPairTop(traderType string, identifier int64, top []model.Top)

SetPairTop sets the cache value for a given time. Resets cache when too many values in it

func SetTradingModeTop

func SetTradingModeTop(traderType string, identifier int64, top []model.Top)

SetTradingModeTop sets the cache value for a given time. Resets cache when too many values in it

Types

type BotCountsCache

type BotCountsCache struct {
	Counts       map[int64]int64
	UpdatesTimes map[int64]int64
}

BotCountsCache stores bot counts cache values

type TopCache

type TopCache struct {
	Exchanges         map[string][]model.Top
	TradingModes      map[string][]model.Top
	Pairs             map[string][]model.Top
	EvaluationConfigs map[string][]model.Top
}

TopCache stores exchanges and trading modes top values

Jump to

Keyboard shortcuts

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