Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigService ¶
type ConfigService struct { AppName string `toml:"app_name"` Version string `toml:"version"` FeedURL string `toml:"feed_url"` MySQL mysqlConfig `toml:"mysql"` HTTP httpEndpointConfig `toml:"http"` }
func (*ConfigService) Load ¶
func (c *ConfigService) Load(file string) error
type CurrencyFeedService ¶
type CurrencyFeedService struct { Feed utils.CurrencyFeed // contains filtered or unexported fields }
func NewCurrencyFeedService ¶
func NewCurrencyFeedService(mysql *MySQLService, url string) *CurrencyFeedService
NewCurrencyFeedService creates new CurrencyFeedService
func (*CurrencyFeedService) Check ¶
func (s *CurrencyFeedService) Check() (bool, error)
Check if feed needs to persited in database
func (*CurrencyFeedService) Fetch ¶
func (s *CurrencyFeedService) Fetch() error
Fetch latest currency RSS2 feed and store it locally
func (*CurrencyFeedService) Persist ¶
func (s *CurrencyFeedService) Persist() error
Persist feed data into database
type CurrencyService ¶
type CurrencyService struct {
// contains filtered or unexported fields
}
func NewCurrencyService ¶
func NewCurrencyService(mysql *MySQLService) *CurrencyService
NewCurrencyService creates new CurrencyService
func (*CurrencyService) BySymbol ¶
func (s *CurrencyService) BySymbol(symbol string, limit int) ([]Currency, error)
BySymbol returns historical values by symbol
func (*CurrencyService) Latest ¶
func (s *CurrencyService) Latest() ([]Currency, error)
Latest currencies
type MySQLService ¶
type MySQLService struct {
// contains filtered or unexported fields
}
func NewMySQLService ¶
func NewMySQLService(user string, password string, address string, database string) (*MySQLService, error)
NewMySQLService creates new MySQLService
func (*MySQLService) Session ¶
func (s *MySQLService) Session() *sqlx.DB
Session returns current database session
func (*MySQLService) Setup ¶
func (s *MySQLService) Setup() error
Setup creates database tables if needed
Click to show internal directories.
Click to hide internal directories.