memory

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2016 License: MIT Imports: 5 Imported by: 1

Documentation

Index

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 New

func New(numCachedIncomes int) *Cache

New creates a new in-memory cache number of cached incomes

func (*Cache) GetLatestConfig

func (c *Cache) GetLatestConfig() models.Config

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

func (c *Cache) IncrementTotalReward(t time.Time, delta int64)

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

func (c *Cache) SetLatestConfig(config models.Config)

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

Jump to

Keyboard shortcuts

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