Documentation ¶
Index ¶
- func NewLedgerReader(filename string) (io.Reader, error)deprecated
- func ParseLedgerAsync(ledgerReader io.Reader) (c chan *Transaction, e chan error)
- type Account
- type Period
- type RangeBalance
- type RangeTransactions
- type RangeType
- type Transaction
- func ParseLedger(ledgerReader io.Reader) (generalLedger []*Transaction, err error)
- func ParseLedgerFile(filename string) (generalLedger []*Transaction, err error)
- func ParseNamedLedger(name string, ledgerReader io.Reader) (generalLedger []*Transaction, err error)
- func TransactionsInDateRange(trans []*Transaction, start, end time.Time) []*Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLedgerReader
deprecated
func ParseLedgerAsync ¶
func ParseLedgerAsync(ledgerReader io.Reader) (c chan *Transaction, e chan error)
ParseLedgerAsync parses a ledger file and returns a Transaction and error channels .
Types ¶
type Account ¶
Account holds the name and balance
func GetBalances ¶
func GetBalances(generalLedger []*Transaction, filterArr []string) []*Account
GetBalances provided a list of transactions and filter strings, returns account balances of all accounts that have any filter as a substring of the account name. Also returns balances for each account level depth as a separate record.
Accounts are sorted by name.
type RangeBalance ¶
RangeBalance contains the account balances and the start and end time of the date range
func BalancesByPeriod ¶
func BalancesByPeriod(trans []*Transaction, per Period, rType RangeType) []*RangeBalance
BalancesByPeriod will return the account balances for each period.
type RangeTransactions ¶
type RangeTransactions struct {
Start, End time.Time
Transactions []*Transaction
}
RangeTransactions contains the transactions and the start and end time of the date range
func TransactionsByPeriod ¶
func TransactionsByPeriod(trans []*Transaction, per Period) []*RangeTransactions
TransactionsByPeriod will return the transactions for each period.
type RangeType ¶
type RangeType string
RangeType is used to specify how the data is "split" into sections
type Transaction ¶
type Transaction struct { Date time.Time Payee string PayeeComment string AccountChanges []Account Comments []string }
Transaction is the basis of a ledger. The ledger holds a list of transactions. A Transaction has a Payee, Date (with no time, or to put another way, with hours,minutes,seconds values that probably doesn't make sense), and a list of Account values that hold the value of the transaction for each account.
func ParseLedger ¶
func ParseLedger(ledgerReader io.Reader) (generalLedger []*Transaction, err error)
ParseLedger parses a ledger file and returns a list of Transactions.
func ParseLedgerFile ¶
func ParseLedgerFile(filename string) (generalLedger []*Transaction, err error)
ParseLedgerFile parses a ledger file and returns a list of Transactions.
func ParseNamedLedger ¶
func ParseNamedLedger(name string, ledgerReader io.Reader) (generalLedger []*Transaction, err error)
ParseNamedLedger parses a ledger file from a reader assuming that it was loaded from the path in name. It will search for included ledger files relative to the given path.
func TransactionsInDateRange ¶
func TransactionsInDateRange(trans []*Transaction, start, end time.Time) []*Transaction
TransactionsInDateRange returns a new array of transactions that are in the date range specified by start and end. The returned list contains transactions on the same day as start but does not include any transactions on the day of end.
Directories ¶
Path | Synopsis |
---|---|
Package decimal implements fixed-point decimal with accuracy to 3 digits of precision after the decimal point.
|
Package decimal implements fixed-point decimal with accuracy to 3 digits of precision after the decimal point. |
cmd/internal/pdr
Package pdr parses date range as string Uses pointlander/peg
|
Package pdr parses date range as string Uses pointlander/peg |