Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortDirectives ¶
SortDirectives sort all directives by their parsed date.
This is called automatically during Parse*(), but can be called on a manually constructed AST.
Types ¶
type AST ¶
type AST struct { Directives Directives `parser:"(@@"` Options []*Option `parser:"| @@ | ~ignore)*"` }
type Balance ¶
type Balance struct { Date *Date `parser:"@Date 'balance'"` Account Account `parser:"@Account"` Amount *Amount `parser:"@@"` // contains filtered or unexported fields }
func (*Balance) AddMetadata ¶
func (w *Balance) AddMetadata(m ...*Metadata)
type Close ¶
type Close struct { Date *Date `parser:"@Date 'close'"` Account Account `parser:"@Account"` // contains filtered or unexported fields }
func (*Close) AddMetadata ¶
func (w *Close) AddMetadata(m ...*Metadata)
type Commodity ¶
type Commodity struct { Date *Date `parser:"@Date 'commodity'"` Currency string `parser:"@Ident"` // contains filtered or unexported fields }
func (*Commodity) AddMetadata ¶
func (w *Commodity) AddMetadata(m ...*Metadata)
type Directive ¶
type Directive interface { WithMetadata Directive() string // contains filtered or unexported methods }
type Directives ¶
type Directives []Directive
func (Directives) Len ¶
func (d Directives) Len() int
func (Directives) Less ¶
func (d Directives) Less(i, j int) bool
func (Directives) Swap ¶
func (d Directives) Swap(i, j int)
type Document ¶
type Document struct { Date *Date `parser:"@Date 'document'"` Account Account `parser:"@Account"` PathToDocument string `parser:"@String"` // contains filtered or unexported fields }
func (*Document) AddMetadata ¶
func (w *Document) AddMetadata(m ...*Metadata)
type Event ¶
type Event struct { Date *Date `parser:"@Date 'event'"` Name string `parser:"@String"` Value string `parser:"@String"` // contains filtered or unexported fields }
func (*Event) AddMetadata ¶
func (w *Event) AddMetadata(m ...*Metadata)
type Note ¶
type Note struct { Date *Date `parser:"@Date 'note'"` Account Account `parser:"@Account"` Description string `parser:"@String"` // contains filtered or unexported fields }
func (*Note) AddMetadata ¶
func (w *Note) AddMetadata(m ...*Metadata)
type Open ¶
type Open struct { Date *Date `parser:"@Date 'open'"` Account Account `parser:"@Account"` ConstraintCurrencies []string `parser:"(@Ident (',' @Ident)*)?"` BookingMethod string `parser:"@('STRICT' | 'NONE')?"` // contains filtered or unexported fields }
func (*Open) AddMetadata ¶
func (w *Open) AddMetadata(m ...*Metadata)
type Pad ¶
type Pad struct { Date *Date `parser:"@Date 'pad'"` Account Account `parser:"@Account"` AccountPad Account `parser:"@Account"` // contains filtered or unexported fields }
func (*Pad) AddMetadata ¶
func (w *Pad) AddMetadata(m ...*Metadata)
type Posting ¶
type Posting struct { Flag string `parser:"@('*' | '!')?"` Account Account `parser:"@Account"` Amount *Amount `parser:"(@@"` PriceTotal bool `parser:"(('@' | @'@@')"` Price *Amount `parser:"@@)?"` Cost *Amount `parser:"('{' @@ '}')?)?"` // contains filtered or unexported fields }
func (*Posting) AddMetadata ¶
func (w *Posting) AddMetadata(m ...*Metadata)
type Price ¶
type Price struct { Date *Date `parser:"@Date 'price'"` Commodity string `parser:"@Ident"` Amount *Amount `parser:"@@"` // contains filtered or unexported fields }
func (*Price) AddMetadata ¶
func (w *Price) AddMetadata(m ...*Metadata)
type Transaction ¶
type Transaction struct { Date *Date `parser:"@Date ('txn' | "` Flag string `parser:"@('*' | '!' | 'P') )"` Payee string `parser:"@(String (?= String))?"` Narration string `parser:"@String?"` Postings []*Posting `parser:"@@*"` // contains filtered or unexported fields }
func (*Transaction) AddMetadata ¶
func (w *Transaction) AddMetadata(m ...*Metadata)
func (*Transaction) Directive ¶
func (t *Transaction) Directive() string
type WithMetadata ¶
type WithMetadata interface {
AddMetadata(...*Metadata)
}
Click to show internal directories.
Click to hide internal directories.