Documentation ¶
Index ¶
- func New(connectionURI string) *mongo.Database
- type Stockinfos
- func (si *Stockinfos) Delete(symbol string) error
- func (si *Stockinfos) Get(symbol string) (model.StockDataInfo, error)
- func (si *Stockinfos) GetAll() ([]model.StockDataInfo, error)
- func (si *Stockinfos) GetAllExpired() ([]model.StockDataInfo, error)
- func (si *Stockinfos) Save(stockData model.StockDataInfo) error
- func (si *Stockinfos) Update(stockData model.StockDataInfo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stockinfos ¶
type Stockinfos struct {
// contains filtered or unexported fields
}
func NewStockinfos ¶
func NewStockinfos(db *mongo.Database) *Stockinfos
func (*Stockinfos) Delete ¶
func (si *Stockinfos) Delete(symbol string) error
Delete removes the given symbol from the database
func (*Stockinfos) Get ¶
func (si *Stockinfos) Get(symbol string) (model.StockDataInfo, error)
Get retreives the stockinfo for the given symbol
func (*Stockinfos) GetAll ¶
func (si *Stockinfos) GetAll() ([]model.StockDataInfo, error)
GetAll retreives all of the objects from the database
func (*Stockinfos) GetAllExpired ¶
func (si *Stockinfos) GetAllExpired() ([]model.StockDataInfo, error)
GetAllExpired returns list of stocks that has at least one value expired
func (*Stockinfos) Save ¶
func (si *Stockinfos) Save(stockData model.StockDataInfo) error
Save writes the stockData to the database
func (*Stockinfos) Update ¶
func (si *Stockinfos) Update(stockData model.StockDataInfo) error
Update sets the fields that were changed in the DB
Click to show internal directories.
Click to hide internal directories.