syntax

package
v0.0.0-...-8236bb3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyTransaction = errors.New("no postings defined")
View Source
var ErrMissingPayee = errors.New("missing payee")
View Source
var ErrUnknownAccount = errors.New("unknown account")

Functions

This section is empty.

Types

type Config

type Config struct {
	Currencies      []string          `yaml:"currencies"`
	Accounts        map[string]string `yaml:"accounts"`
	DefaultCurrency string            `yaml:"defaultCurrency"`
}

type Posting

type Posting struct {
	Account  string
	Amount   float64
	Currency string
	Flag     string
}

type Transaction

type Transaction struct {
	Date      string
	Payee     string
	Narration string
	Flag      string
	Postings  []*Posting
}

func Parse

func Parse(tokens []string, cfg *Config) (*Transaction, error)

func (*Transaction) ToBeanLanguageSyntax

func (txn *Transaction) ToBeanLanguageSyntax() string

func (*Transaction) Validate

func (txn *Transaction) Validate() error

Jump to

Keyboard shortcuts

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