Documentation
¶
Index ¶
- type Cache
- func (c *Cache) GetLatestConfig() models.Config
- func (c *Cache) GetLatestIncomes() []interface{}
- func (c *Cache) GetLatestTotalReward() models.TotalReward
- func (c *Cache) GetRewardRatesByType(t string) []models.RewardRate
- func (c *Cache) IncrementTotalReward(t time.Time, delta int64)
- func (c *Cache) InsertIncome(income interface{})
- func (c *Cache) SetLatestConfig(config models.Config)
- func (c *Cache) SetRewardRates(t string, rates []models.RewardRate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache implements cache.Cache interface with memory
func (*Cache) GetLatestConfig ¶
GetLatestConfig returns latest system config
func (*Cache) GetLatestIncomes ¶
func (c *Cache) GetLatestIncomes() []interface{}
GetLatestIncomes returns incomes
func (*Cache) GetLatestTotalReward ¶
func (c *Cache) GetLatestTotalReward() models.TotalReward
GetLatestTotalReward returns total reward of today
func (*Cache) GetRewardRatesByType ¶
func (c *Cache) GetRewardRatesByType(t string) []models.RewardRate
GetRewardRatesByType returns reward rates by type
func (*Cache) IncrementTotalReward ¶
IncrementTotalReward increment total reward today by delta if day matches
func (*Cache) InsertIncome ¶
func (c *Cache) InsertIncome(income interface{})
InsertIncome inserts a new income
func (*Cache) SetLatestConfig ¶
SetLatestConfig sets latest system config in cache
func (*Cache) SetRewardRates ¶
func (c *Cache) SetRewardRates(t string, rates []models.RewardRate)
SetRewardRates sets reward rates with type
Click to show internal directories.
Click to hide internal directories.