report

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collapse

type Collapse struct {
	Level int
	Regex *regexp.Regexp
}

Collapse is a rule for collapsing (shortening) accounts.

type Config added in v0.0.3

type Config struct {
	Commodities bool
}

Config configures a Renderer.

type Options

type Options struct {
	Valuation *int
	Collapse  []Collapse
}

Options contains configuration options to create a report.

type Renderer

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

Renderer renders a report.

func NewRenderer

func NewRenderer(config Config) *Renderer

NewRenderer creates a new report renderer.

func (*Renderer) Render

func (rn *Renderer) Render(r *Report) *table.Table

Render renders a report.

type Report

type Report struct {
	Dates       []time.Time
	Options     Options
	Segments    map[accounts.AccountType]*Segment
	Commodities []*commodities.Commodity
	Positions   map[*commodities.Commodity]amount.Vec
}

Report is a balance report for a range of dates.

func NewReport

func NewReport(options Options, bal []*balance.Balance) (*Report, error)

NewReport creates a new report.

type Segment

type Segment struct {
	Key         string
	Positions   map[*commodities.Commodity]amount.Vec
	Subsegments []*Segment
}

Segment is a hierarchical segment of a report.

func NewSegment

func NewSegment(k string) *Segment

NewSegment creates a new segment.

Jump to

Keyboard shortcuts

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