Versions in this module Expand all Collapse all v0 v0.1.0 Feb 6, 2020 Changes in this version + func DeleteAllPortfolios() (bool, error) + func DeletePortfolio(portfolioID string) (bool, error) + func Init(config Config) error + type Config struct + DbName string + MongoURL string + type Currency string + const EUR + const RUB + const USD + type Operation struct + Currency Currency + DateTime time.Time + FIGI string + OperationID string + OperationType Type + PortfolioID string + Price float64 + Volume int64 + type Portfolio struct + Description string + Name string + PortfolioID string + func AddPortfolio(name string, description string) (Portfolio, error) + func GetAllPortfolios() ([]Portfolio, error) + func GetPortfolio(portfolioID string) (bool, Portfolio, error) + func (p *Portfolio) AddOperation(op Operation) (string, error) + func (p *Portfolio) DeleteAllOperations() (int64, error) + func (p *Portfolio) GetAllOperations() ([]Operation, error) + func (p *Portfolio) GetAllOperationsByFigi(figi string) ([]Operation, error) + func (p *Portfolio) GetAveragePriceByFigi(figi string) (float64, error) + func (p *Portfolio) GetAveragePriceByFigiTillDate(figi string, dt time.Time) (float64, error) + func (p *Portfolio) GetBalanceByCurrency(curr Currency) (float64, error) + func (p *Portfolio) GetBalanceByCurrencyTillDate(curr Currency, dt time.Time) (float64, error) + func (p *Portfolio) GetBalanceByFigi(figi string) (float64, error) + func (p *Portfolio) GetBalanceByFigiTillDate(figi string, dt time.Time) (float64, error) + func (p *Portfolio) GetOperationByID(operationID string) (Operation, error) + func (p *Portfolio) String() string + func (p *Portfolio) UpdatePortfolio() (bool, error) + type Type string + const BrokerCommission + const Buy + const Coupon + const ExchangeCommission + const PayIn + const PayOut + const Sell