Documentation ¶
Index ¶
- Variables
- func IsValidAsset(asset string) bool
- type Asset
- type Database
- func (d *Database) AutoMigrate() error
- func (d *Database) Close() error
- func (d *Database) GetAllPrices(asset string) ([]*Price, error)
- func (d *Database) LastPrice(asset string) (float64, error)
- func (d *Database) PriceAvgInRange(asset string, windowInDays int) (float64, error)
- func (d *Database) PriceChangeInRange(asset string, windowInDays int) (float64, error)
- func (d *Database) PricesInRange(asset string, windowInDays int) ([]*Price, error)
- func (d *Database) RecordPrice(asset string, price float64) error
- type Opts
- type Price
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsValidAsset ¶
IsValidAsset determines whether or not the given asset is one we are tracking
Types ¶
type Asset ¶
type Asset string
Asset is a given crypto asset tracked by it's Ticker symbol
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) AutoMigrate ¶
AutoMigrate is used to automatically migrate datbase tables
func (*Database) GetAllPrices ¶
GetAllPrices returns all price entries for a given asset
func (*Database) PriceAvgInRange ¶
PriceAvgInRange returns the average price of the given asset during the last N days
func (*Database) PriceChangeInRange ¶
PriceChangeInRange returns the price change percentage in the last N days
func (*Database) PricesInRange ¶ added in v0.0.14
PricesInRange returns all prices items in the given range
Click to show internal directories.
Click to hide internal directories.