process

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator added in v0.0.16

type Aggregator struct {
	Mappers   amounts.Mapper
	Filter    filter.Filter[amounts.Key]
	Valuation *journal.Commodity
	Value     bool

	Collection Collection
}

func (*Aggregator) Sink added in v0.0.16

func (agg *Aggregator) Sink(ctx context.Context, inCh <-chan *ast.Day) error

type Balancer added in v0.0.15

type Balancer struct {
	Context journal.Context
}

Balancer processes ASTs.

func (*Balancer) Process added in v0.0.15

func (pr *Balancer) Process(ctx context.Context, inCh <-chan *ast.Day, outCh chan<- *ast.Day) error

Process processes days.

type Collection added in v0.0.16

type Collection interface {
	Insert(k amounts.Key, v decimal.Decimal)
}

type Error

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

Error is an error.

func (Error) Error

func (be Error) Error() string

type JournalSource added in v0.0.15

type JournalSource struct {
	Context journal.Context

	Path     string
	Expand   bool
	Filter   journal.Filter
	AutoLoad bool
	// contains filtered or unexported fields
}

JournalSource emits journal data in daily batches.

func (*JournalSource) Load added in v0.0.16

func (js *JournalSource) Load(ctx context.Context) error

func (JournalSource) Max added in v0.0.16

func (js JournalSource) Max() time.Time

func (JournalSource) Min added in v0.0.16

func (js JournalSource) Min() time.Time

func (JournalSource) Source added in v0.0.15

func (js JournalSource) Source(ctx context.Context, outCh chan<- *ast.Day) error

type PeriodDiffer added in v0.0.15

type PeriodDiffer struct {
	Valuation *journal.Commodity
}

PeriodDiffer filters the incoming days according to the dates specified.

func (PeriodDiffer) Process added in v0.0.15

func (pf PeriodDiffer) Process(ctx context.Context, inCh <-chan *ast.Period, outCh chan<- *ast.Period) error

Process does the diffing.

type PeriodFilter

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

PeriodFilter filters the incoming days according to the dates specified.

func (*PeriodFilter) Process added in v0.0.15

func (pf *PeriodFilter) Process(ctx context.Context, inCh <-chan *ast.Day, outCh chan<- *ast.Period) error

Process does the filtering.

type PriceUpdater

type PriceUpdater struct {
	Valuation *journal.Commodity
}

PriceUpdater updates the prices in a stream of days.

func (PriceUpdater) Process added in v0.0.15

func (pu PriceUpdater) Process(ctx context.Context, inCh <-chan *ast.Day, outCh chan<- *ast.Day) error

Process computes prices.

type Valuator

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

Valuator produces valuated days.

func (*Valuator) Process added in v0.0.15

func (pr *Valuator) Process(ctx context.Context, inCh <-chan *ast.Day, outCh chan<- *ast.Day) error

Process computes prices.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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