filters

package
v0.0.0-...-47f653c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

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

type AmountFilter func(amt int64) bool

AmountFilter filters by amount. Returns true if amt should be included or false otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL