Documentation ¶
Index ¶
- Constants
- func GetStore(dbtype config.DbType, dsn string) (store store.Store, err error)
- type DbStore
- type Price
- type Split
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Delete(list ...interface{}) (int64, error)
- func (tx *Tx) DeleteAccount(account *models.Account) error
- func (tx *Tx) DeletePrice(price *models.Price) error
- func (tx *Tx) DeleteReport(report *models.Report) error
- func (tx *Tx) DeleteSecurity(s *models.Security) error
- func (tx *Tx) DeleteSession(session *models.Session) error
- func (tx *Tx) DeleteTransaction(t *models.Transaction, user *models.User) error
- func (tx *Tx) DeleteUser(user *models.User) error
- func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (tx *Tx) FindMatchingAccounts(account *models.Account) (*[]*models.Account, error)
- func (tx *Tx) FindMatchingSecurities(security *models.Security) (*[]*models.Security, error)
- func (tx *Tx) GetAccount(accountid int64, userid int64) (*models.Account, error)
- func (tx *Tx) GetAccountBalance(user *models.User, accountid int64) (*models.Amount, error)
- func (tx *Tx) GetAccountBalanceDate(user *models.User, accountid int64, date *time.Time) (*models.Amount, error)
- func (tx *Tx) GetAccountBalanceDateRange(user *models.User, accountid int64, begin, end *time.Time) (*models.Amount, error)
- func (tx *Tx) GetAccountTransactions(user *models.User, accountid int64, sort string, page uint64, limit uint64) (*models.AccountTransactionsList, error)
- func (tx *Tx) GetAccounts(userid int64) (*[]*models.Account, error)
- func (tx *Tx) GetEarliestPrice(security, currency *models.Security, date *time.Time) (*models.Price, error)
- func (tx *Tx) GetLatestPrice(security, currency *models.Security, date *time.Time) (*models.Price, error)
- func (tx *Tx) GetPrice(priceid, securityid int64) (*models.Price, error)
- func (tx *Tx) GetPrices(securityid int64) (*[]*models.Price, error)
- func (tx *Tx) GetReport(reportid int64, userid int64) (*models.Report, error)
- func (tx *Tx) GetReports(userid int64) (*[]*models.Report, error)
- func (tx *Tx) GetSecurities(userid int64) (*[]*models.Security, error)
- func (tx *Tx) GetSecurity(securityid int64, userid int64) (*models.Security, error)
- func (tx *Tx) GetSession(secret string) (*models.Session, error)
- func (tx *Tx) GetTransaction(transactionid int64, userid int64) (*models.Transaction, error)
- func (tx *Tx) GetTransactions(userid int64) (*[]*models.Transaction, error)
- func (tx *Tx) GetUser(userid int64) (*models.User, error)
- func (tx *Tx) GetUserByUsername(username string) (*models.User, error)
- func (tx *Tx) Insert(list ...interface{}) error
- func (tx *Tx) InsertAccount(account *models.Account) error
- func (tx *Tx) InsertPrice(price *models.Price) error
- func (tx *Tx) InsertReport(report *models.Report) error
- func (tx *Tx) InsertSecurity(s *models.Security) error
- func (tx *Tx) InsertSession(session *models.Session) error
- func (tx *Tx) InsertTransaction(t *models.Transaction, user *models.User) error
- func (tx *Tx) InsertUser(user *models.User) error
- func (tx *Tx) PriceExists(price *models.Price) (bool, error)
- func (tx *Tx) Rebind(query string) string
- func (tx *Tx) Rollback() error
- func (tx *Tx) Select(i interface{}, query string, args ...interface{}) ([]interface{}, error)
- func (tx *Tx) SelectInt(query string, args ...interface{}) (int64, error)
- func (tx *Tx) SelectOne(holder interface{}, query string, args ...interface{}) error
- func (tx *Tx) SessionExists(secret string) (bool, error)
- func (tx *Tx) SplitExists(s *models.Split) (bool, error)
- func (tx *Tx) Update(list ...interface{}) (int64, error)
- func (tx *Tx) UpdateAccount(account *models.Account) error
- func (tx *Tx) UpdatePrice(price *models.Price) error
- func (tx *Tx) UpdateReport(report *models.Report) error
- func (tx *Tx) UpdateSecurity(security *models.Security) error
- func (tx *Tx) UpdateTransaction(t *models.Transaction, user *models.User) error
- func (tx *Tx) UpdateUser(user *models.User) error
- func (tx *Tx) UsernameExists(username string) (bool, error)
Constants ¶
View Source
const MaxPrecision uint64 = 15
MaxPrexision denotes the maximum valid value for models.Security.Precision. This constant is used when storing amounts in securities into the database, so it must not be changed without appropriately migrating the database.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Price ¶
type Price struct { PriceId int64 SecurityId int64 CurrencyId int64 Date time.Time WholeValue int64 FractionalValue int64 RemoteId string // unique ID from source, for detecting duplicates }
Price is a mirror of models.Price with the Value broken out into whole and fractional components
type Split ¶
type Split struct { SplitId int64 TransactionId int64 Status int64 ImportSplitType int64 // One of AccountId and SecurityId must be -1 // In normal splits, AccountId will be valid and SecurityId will be -1. The // only case where this is reversed is for transactions that have been // imported and not yet associated with an account. AccountId int64 SecurityId int64 RemoteId string // unique ID from server, for detecting duplicates Number string // Check or reference number Memo string // Amount.Whole and Amount.Fractional(MaxPrecision) WholeAmount int64 FractionalAmount int64 }
Split is a mirror of models.Split with the Amount broken out into whole and fractional components
type Tx ¶
type Tx struct { Dialect gorp.Dialect Tx *gorp.Transaction }
func (*Tx) DeleteTransaction ¶
func (*Tx) FindMatchingAccounts ¶
func (*Tx) FindMatchingSecurities ¶
func (*Tx) GetAccount ¶
func (*Tx) GetAccountBalance ¶
func (*Tx) GetAccountBalanceDate ¶
func (*Tx) GetAccountBalanceDateRange ¶
func (*Tx) GetAccountTransactions ¶
func (*Tx) GetEarliestPrice ¶
func (tx *Tx) GetEarliestPrice(security, currency *models.Security, date *time.Time) (*models.Price, error)
Return the earliest price for security in currency units after date
func (*Tx) GetLatestPrice ¶
func (tx *Tx) GetLatestPrice(security, currency *models.Security, date *time.Time) (*models.Price, error)
Return the latest price for security in currency units before date
func (*Tx) GetSecurity ¶
func (*Tx) GetTransaction ¶
func (*Tx) GetTransactions ¶
func (tx *Tx) GetTransactions(userid int64) (*[]*models.Transaction, error)
func (*Tx) GetUserByUsername ¶
func (*Tx) InsertTransaction ¶
func (*Tx) UpdateTransaction ¶
Click to show internal directories.
Click to hide internal directories.