Documentation
¶
Index ¶
- type AST
- func (ast *AST) AddAssertion(a *Assertion)
- func (ast *AST) AddClose(c *Close)
- func (ast *AST) AddOpen(o *Open)
- func (ast *AST) AddPrice(p *Price)
- func (ast *AST) AddTransaction(t *Transaction)
- func (ast *AST) AddValue(v *Value)
- func (ast *AST) Day(d time.Time) *Day
- func (ast *AST) SortedDays() []*Day
- type Accrual
- type Assertion
- type Close
- type Currency
- type Day
- type Directive
- type Include
- type Lot
- type Open
- type Posting
- type Price
- type Range
- type Tag
- type Transaction
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AST ¶
AST represents an unprocessed abstract syntax tree.
func (*AST) AddAssertion ¶
AddAssertion adds an Assertion directive.
func (*AST) AddTransaction ¶
func (ast *AST) AddTransaction(t *Transaction)
AddTransaction adds an Transaction directive.
func (*AST) SortedDays ¶
SortedDays returns all days ordered by date.
type Accrual ¶
Accrual represents an accrual.
func (Accrual) Expand ¶
func (a Accrual) Expand(t *Transaction) []*Transaction
Expand expands an accrual transaction.
type Assertion ¶
type Assertion struct { Range Date time.Time Account *journal.Account Amount decimal.Decimal Commodity *journal.Commodity }
Assertion represents a balance assertion.
type Day ¶
type Day struct { Date time.Time Prices []*Price Assertions []*Assertion Values []*Value Openings []*Open Transactions []*Transaction Closings []*Close }
Day groups all commands for a given date.
type Directive ¶
type Directive interface {
Position() Range
}
Directive is an element in a journal with a position.
type Posting ¶
type Posting struct { Amount decimal.Decimal Credit, Debit *journal.Account Commodity *journal.Commodity Targets []*journal.Commodity Lot *Lot }
Posting represents a posting.
func NewPosting ¶
func NewPosting(crAccount, drAccount *journal.Account, commodity *journal.Commodity, amt decimal.Decimal) Posting
NewPosting creates a new posting from the given parameters. If amount is negative, it will be inverted and the accounts reversed.
func NewPostingWithTargets ¶
func NewPostingWithTargets(crAccount, drAccount *journal.Account, commodity *journal.Commodity, amt decimal.Decimal, targets []*journal.Commodity) Posting
NewPostingWithTargets creates a new posting from the given parameters. If amount is negative, it will be inverted and the accounts reversed.
type Price ¶
type Price struct { Range Date time.Time Commodity *journal.Commodity Target *journal.Commodity Price decimal.Decimal }
Price represents a price command.
type Transaction ¶
type Transaction struct { Range Date time.Time Description string Tags []Tag Postings []Posting AddOns []interface{} }
Transaction represents a transaction.
func (Transaction) Commodities ¶
func (t Transaction) Commodities() map[*journal.Commodity]bool
Commodities returns the commodities in this transaction.
func (*Transaction) Less ¶
func (t *Transaction) Less(t2 *Transaction) bool
Less defines an order on transactions.