Documentation ¶
Index ¶
- func ImportCompanies(filePath string, r Redis) error
- func SetRedis(redis Redis)
- type Company
- type Controller
- func (c Controller) All() ([]*Company, error)
- func (c Controller) Bottom10() ([]*Company, error)
- func (c Controller) GetBySymbol(symbols []string) ([]*Company, error)
- func (c Controller) InRank(start, end int64) ([]*Company, error)
- func (c Controller) Top10() ([]*Company, error)
- func (c Controller) UpdateRank(symbol string, amount float64) error
- type Redis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportCompanies ¶
Types ¶
type Company ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func Instance ¶
func Instance() *Controller
func (Controller) All ¶
func (c Controller) All() ([]*Company, error)
func (Controller) Bottom10 ¶
func (c Controller) Bottom10() ([]*Company, error)
func (Controller) GetBySymbol ¶
func (c Controller) GetBySymbol(symbols []string) ([]*Company, error)
func (Controller) Top10 ¶
func (c Controller) Top10() ([]*Company, error)
func (Controller) UpdateRank ¶
func (c Controller) UpdateRank(symbol string, amount float64) error
type Redis ¶
type Redis interface { HSet(key, field string, value interface{}) error HGetAll(key string) (map[string]string, error) ZAdd(key string, member string, score float64) error ZRevRange(key string, start, stop int64) ([]*Company, error) ZRange(key string, start, stop int64) ([]*Company, error) ZScore(key, member string) (float64, error) ZIncrBy(key string, increment float64, member string) error ZCount(key, min, max string) (int64, error) }
Click to show internal directories.
Click to hide internal directories.