report

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.0.8

type Builder struct {
	Value    bool
	Collapse []Collapse
}

Builder contains configuration options to create a report.

func (Builder) Build added in v0.0.8

func (b Builder) Build(bal []*balance.Balance) (*Report, error)

Build creates a new report.

type Collapse

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

Collapse is a rule for collapsing (shortening) accounts.

func (Collapse) MatchAccount added in v0.0.8

func (c Collapse) MatchAccount(a *ledger.Account) bool

MatchAccount determines whether this Collapse matches the given Account.

type Position added in v0.0.7

type Position struct {
	balance.CommodityAccount
	Amounts vector.Vector
}

Position is a position.

type Renderer

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

Renderer renders a report.

func (*Renderer) Render

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

Render renders a report.

type Report

type Report struct {
	Dates       []time.Time
	Segments    map[ledger.AccountType]*Segment
	Commodities []*ledger.Commodity
	Positions   map[*ledger.Commodity]vector.Vector
}

Report is a balance report for a range of dates.

type Segment

type Segment struct {
	Key         string
	Positions   map[*ledger.Commodity]vector.Vector
	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