database

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(connectionURI string) *mongo.Database

New creates a new database client connection

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL