Documentation
¶
Index ¶
- func Connect(c dbConf) (*sqlx.DB, error)
- func New(c Config, r *Repository, s Screen, i Input) (*monujo, error)
- type Alphavantage
- type Bankier
- type Config
- type Currencies
- type Currency
- type FinancialOperationType
- type FinancialOperationTypes
- type Generali
- type Google
- type Ingturbo
- type Input
- type Operation
- type OperationType
- type OperationTypes
- type Operations
- type OwnedStock
- type OwnedStocks
- type Portfolio
- type PortfolioExt
- type Portfolios
- type PortfoliosExt
- type Quote
- type Quotes
- type Repository
- func (r *Repository) Currencies() (Currencies, error)
- func (r *Repository) DeleteOperation(operation Operation) error
- func (r *Repository) DeleteTransaction(transaction Transaction) error
- func (r *Repository) FinancialOperationTypes() (FinancialOperationTypes, error)
- func (r *Repository) OwnedStocks() (OwnedStocks, error)
- func (r *Repository) PortfolioOperations(portfolio Portfolio) (Operations, error)
- func (r *Repository) PortfolioTransactions(portfolio Portfolio) (Transactions, error)
- func (r *Repository) Portfolios() (Portfolios, error)
- func (r *Repository) PortfoliosExt() (PortfoliosExt, error)
- func (r *Repository) Securities(tickers []string) (Securities, error)
- func (r *Repository) SecurityExists(ticker string) (bool, error)
- func (r *Repository) Sources() (Sources, error)
- func (r *Repository) StoreLatestQuote(quote Quote) (string, error)
- func (r *Repository) StoreOperation(operation Operation) (int64, error)
- func (r *Repository) StoreSecurity(s Security) (string, error)
- func (r *Repository) StoreTransaction(transaction Transaction) (int64, error)
- func (r *Repository) UpdateQuotes(sources Sources) (chan Quote, error)
- type Screen
- type Securities
- type Security
- type Source
- type Sources
- type Stock
- type Stooq
- type Sw
- type Transaction
- type Transactions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alphavantage ¶
type Alphavantage Source
type Currencies ¶
type Currencies []Currency
func (*Currencies) CurrencyPairs ¶
func (currencies *Currencies) CurrencyPairs(base string) []string
type FinancialOperationType ¶
type FinancialOperationType struct {
OperationType
}
type FinancialOperationTypes ¶
type FinancialOperationTypes []FinancialOperationType
type OperationType ¶
type OperationType struct {
Type string `db:"type"`
}
type OperationTypes ¶
type OperationTypes []OperationType
type Operations ¶
type Operations []Operation
type OwnedStock ¶
type OwnedStock struct { Stock PortfolioId int64 `db:"portfolio_id"` PortfolioName string `db:"portfolio_name"` ExchangeRate sql.NullFloat64 `db:"exchange_rate"` LastPriceBaseCurrency sql.NullFloat64 `db:"last_price_base_currency"` AveragePrice float64 `db:"average_price"` AveragePriceBaseCurrency float64 `db:"average_price_base_currency"` InvestmentBaseCurrency sql.NullFloat64 `db:"investment_base_currency"` MarketValueBaseCurrency sql.NullFloat64 `db:"market_value_base_currency"` Gain sql.NullFloat64 `db:"gain"` PercentageGain sql.NullFloat64 `db:"percentage_gain"` GainBaseCurrency sql.NullFloat64 `db:"gain_base_currency"` PercentageGainBaseCurrency sql.NullFloat64 `db:"percentage_gain_base_currency"` AveragePriceAdjusted float64 `db:"average_price_adjusted"` GainAdjusted sql.NullFloat64 `db:"gain_adjusted"` PercentageGainAdjusted sql.NullFloat64 `db:"percentage_gain_adjusted"` GainAdjustedBaseCurrency sql.NullFloat64 `db:"gain_adjusted_base_currency"` PercentageGainAdjustedBaseCurrency sql.NullFloat64 `db:"percentage_gain_adjusted_base_currency"` }
type OwnedStocks ¶
type OwnedStocks []OwnedStock
func (*OwnedStocks) DistinctTickers ¶
func (stocks *OwnedStocks) DistinctTickers() []string
type PortfolioExt ¶
type PortfolioExt struct { Portfolio CacheValue sql.NullFloat64 `db:"cache_value"` Commision sql.NullFloat64 `db:"commision"` Tax sql.NullFloat64 `db:"tax"` EstimatedGain sql.NullFloat64 `db:"estimated_gain"` EstimatedGainCostsInc sql.NullFloat64 `db:"estimated_gain_costs_inc"` EstimatedValue sql.NullFloat64 `db:"estimated_value"` AnnualBalance float64 `db:"annual_balance"` MonthBalance float64 `db:"month_balance"` }
type Portfolios ¶
type Portfolios []Portfolio
type PortfoliosExt ¶
type PortfoliosExt []PortfolioExt
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sqlx.DB, c Config) (*Repository, error)
func (*Repository) Currencies ¶
func (r *Repository) Currencies() (Currencies, error)
func (*Repository) DeleteOperation ¶
func (r *Repository) DeleteOperation(operation Operation) error
func (*Repository) DeleteTransaction ¶
func (r *Repository) DeleteTransaction(transaction Transaction) error
func (*Repository) FinancialOperationTypes ¶
func (r *Repository) FinancialOperationTypes() (FinancialOperationTypes, error)
func (*Repository) OwnedStocks ¶
func (r *Repository) OwnedStocks() (OwnedStocks, error)
func (*Repository) PortfolioOperations ¶
func (r *Repository) PortfolioOperations(portfolio Portfolio) (Operations, error)
func (*Repository) PortfolioTransactions ¶
func (r *Repository) PortfolioTransactions(portfolio Portfolio) (Transactions, error)
func (*Repository) Portfolios ¶
func (r *Repository) Portfolios() (Portfolios, error)
func (*Repository) PortfoliosExt ¶
func (r *Repository) PortfoliosExt() (PortfoliosExt, error)
func (*Repository) Securities ¶
func (r *Repository) Securities(tickers []string) (Securities, error)
func (*Repository) SecurityExists ¶
func (r *Repository) SecurityExists(ticker string) (bool, error)
func (*Repository) Sources ¶
func (r *Repository) Sources() (Sources, error)
func (*Repository) StoreLatestQuote ¶
func (r *Repository) StoreLatestQuote(quote Quote) (string, error)
func (*Repository) StoreOperation ¶
func (r *Repository) StoreOperation(operation Operation) (int64, error)
func (*Repository) StoreSecurity ¶
func (r *Repository) StoreSecurity(s Security) (string, error)
func (*Repository) StoreTransaction ¶
func (r *Repository) StoreTransaction(transaction Transaction) (int64, error)
func (*Repository) UpdateQuotes ¶
func (r *Repository) UpdateQuotes(sources Sources) (chan Quote, error)
type Securities ¶
type Securities []Security
type Stock ¶
type Stock struct { Ticker string `db:"ticker"` ShortName sql.NullString `db:"short_name"` LastPrice sql.NullFloat64 `db:"last_price"` Currency string `db:"currency"` }
func (*Stock) DisplayName ¶
type Transaction ¶
type Transaction struct { TransactionId int64 `db:"transaction_id"` PortfolioId int64 `db:"portfolio_id"` Date time.Time `db:"date"` Ticker string `db:"ticker"` Price float64 `db:"price"` Currency string `db:"currency"` Commision float64 `db:"commision"` ExchangeRate float64 `db:"exchange_rate"` Tax float64 `db:"tax"` }
type Transactions ¶
type Transactions []Transaction
Click to show internal directories.
Click to hide internal directories.