csv

package
v0.0.0-...-5a71971 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteLedger

func WriteLedger(l ledger.Ledger, filename string) error

Types

type ColumnFormat

type ColumnFormat struct {
	ID      int
	Date    int
	Person  int
	Memo    int
	Value   int
	Type    int
	Balance int
	Label   int
	Others  []int
}

Columns are 1-indexed; 0 means column not present

type Source

type Source struct {
	SourceName      string
	Columns         ColumnFormat
	DateFormat      string `yaml:"date_format"`
	HeaderRows      int    `yaml:"header_rows"`
	FooterRows      int    `yaml:"header_rows"`
	OrderDescending bool   `yaml:"order_descending"`
	// called after the entry has been populated with defined columns
	// returns true if entry should be ignored
	PostProcessEntry func(*ledger.Entry, []string) error
	// generate unique ID for deduplication
	GenerateID        func(ledger.Entry) string
	FileSearchPattern file.SearchPattern
}

func (*Source) GetLedgerEntries

func (s *Source) GetLedgerEntries(year int) ([]ledger.Entry, error)

func (*Source) LedgerEntriesFromFile

func (s *Source) LedgerEntriesFromFile(filename string, year int) ([]ledger.Entry, error)

Jump to

Keyboard shortcuts

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