Documentation ¶
Overview ¶
Package store implements persistent data storage with clean API. Please note that time.Time values are always stored in UTC in the database.
Index ¶
- type Store
- func (s *Store) CreateCountry(c *model.Country) error
- func (s *Store) CreateItem(item *model.Item) error
- func (s *Store) CreateMarket(c *model.Market) error
- func (s *Store) GetCountry(id int64) (*model.Country, error)
- func (s *Store) GetCountryByName(name string) (*model.Country, error)
- func (s *Store) GetCurrency(code currency.Currency) (*model.Currency, error)
- func (s *Store) GetCurrencyMultiplier(date time.Time, from currency.Currency, to currency.Currency) (float64, error)
- func (s *Store) GetItem(id int64) (*model.Item, error)
- func (s *Store) GetItemByCode(code string) (*model.Item, error)
- func (s *Store) GetMarket(id int64) (*model.Market, error)
- func (s *Store) GetOrCreateCountry(name string) (*model.Country, error)
- func (s *Store) GetOrCreateCurrency(code currency.Currency) (*model.Currency, error)
- func (s *Store) StoreCurrencyMultiplier(date time.Time, from currency.Currency, to currency.Currency, mult float64) error
- func (s *Store) UpdateCountry(c *model.Country) error
- func (s *Store) UpdateItem(item *model.Item) error
- func (s *Store) UpdateMarket(c *model.Market) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the persistent storage
func (*Store) GetCountryByName ¶
func (*Store) GetCurrency ¶
GetCurrency returns currency detail for specified currency code
func (*Store) GetCurrencyMultiplier ¶
func (s *Store) GetCurrencyMultiplier(date time.Time, from currency.Currency, to currency.Currency) (float64, error)
GetCurrencyMultiplier finds multiplier for converting "from" currency to "to" currency. It does not check reverse record.
func (*Store) GetOrCreateCountry ¶
func (*Store) GetOrCreateCurrency ¶
GetOrCreateCurrency returns currency detail or creates a new currency Nil is returned on error.
Click to show internal directories.
Click to hide internal directories.