process

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASTBuilder

type ASTBuilder struct {
	Context journal.Context
}

ASTBuilder builds an abstract syntax tree.

func (*ASTBuilder) BuildAST

func (pr *ASTBuilder) BuildAST(ctx context.Context, inCh <-chan ast.Directive) (<-chan *ast.AST, <-chan error)

BuildAST reads directives from the given channel and builds a Ledger if successful.

type ASTExpander

type ASTExpander struct {
	Expand bool
	Filter journal.Filter
}

ASTExpander expands and filters the given AST.

func (*ASTExpander) ExpandAndFilterAST

func (pr *ASTExpander) ExpandAndFilterAST(ctx context.Context, inCh <-chan *ast.AST) (<-chan *ast.AST, <-chan error)

ExpandAndFilterAST processes the given AST.

type Differ

type Differ struct {
	Diff bool
}

Differ filters the incoming days according to the dates specified.

func (Differ) ProcessStream

func (pf Differ) ProcessStream(ctx context.Context, inCh <-chan *val.Day) (<-chan *val.Day, <-chan error)

ProcessStream does the filtering.

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is an error.

func (Error) Error

func (be Error) Error() string

type PASTBuilder

type PASTBuilder struct {

	// The context of this journal.
	Context journal.Context
}

PASTBuilder processes ASTs.

func (*PASTBuilder) ProcessAST

func (pr *PASTBuilder) ProcessAST(ctx context.Context, inCh <-chan *ast.AST) (<-chan *past.Day, <-chan error)

ProcessAST processes an AST to a stream of past.Day. It check assertions and the usage of open and closed accounts. It will also resolve Value directives and convert them to transactions.

type PeriodFilter

type PeriodFilter struct {
	From, To time.Time
	Interval date.Interval
	Last     int
	Diff     bool
}

PeriodFilter filters the incoming days according to the dates specified.

func (PeriodFilter) ProcessStream

func (pf PeriodFilter) ProcessStream(ctx context.Context, inCh <-chan *val.Day) (<-chan *val.Day, <-chan error)

ProcessStream does the filtering.

type PriceUpdater

type PriceUpdater struct {
	Context   journal.Context
	Valuation *journal.Commodity
}

PriceUpdater updates the prices in a stream of days.

func (PriceUpdater) ProcessStream

func (pr PriceUpdater) ProcessStream(ctx context.Context, inCh <-chan *past.Day) (<-chan *val.Day, <-chan error)

ProcessStream computes prices.

type Valuator

type Valuator struct {
	Context   journal.Context
	Valuation *journal.Commodity
}

Valuator produces valuated days.

func (*Valuator) ProcessStream

func (pr *Valuator) ProcessStream(ctx context.Context, inCh <-chan *val.Day) (chan *val.Day, chan error)

ProcessStream computes prices.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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