Documentation
¶
Overview ¶
Package filters contains useful search filters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileAdvanceSearchSpec ¶
func CompileAdvanceSearchSpec( spec *AdvanceSearchSpec) func(ptr *fin.Entry) bool
CompileAdvanceSearchSpec compiles a search specification.
func WithBalance ¶
func WithBalance(balance int64) func(entry fin.Entry) fin.EntryBalance
WithBalance returns a function that maps a fin.Entry to a fin.EntryBalance. balance is the current balance of the account. fin.Entry values must be passed to returned function from newest to oldest.
Types ¶
type AdvanceSearchSpec ¶
type AdvanceSearchSpec struct { Name string Desc string // If non-zero, include only entries for given account. AccountId int64 // If present, include only entries with line items that match CF. CF fin.CatFilter // If present, include only entries whose total matches AF. AF AmountFilter }
AdvanceSearchSpec specifies what entries to search for. searches ignore case and whitespace.
type AmountFilter ¶
AmountFilter filters by amount. Returns true if amt should be included or false otherwise.
Click to show internal directories.
Click to hide internal directories.