Documentation
¶
Index ¶
Constants ¶
View Source
const RecordTemplate = `` /* 254-byte string literal not displayed */
RecordTemplate is the default template for formatting records
Variables ¶
This section is empty.
Functions ¶
func ProcessCsvFile ¶
ProcessCsvFile ...
Types ¶
type Config ¶
type Config struct {
Csv CsvConfig
TransactionsRules TransactionsRulesConfig
}
Config represents the config
type CsvConfig ¶
type CsvConfig struct {
AmountIn int // The amount in field index
AmountOut int // The amount out field index
Currency string // The currency to use
Date int // The date field index
DateLayoutIn string // The parsing format
DateLayoutOut string // The date output format
DefaultAccount string // The default account for transactions if no rule matches
Description int // The description field index
Fields int // Validate no. of fields; -1 is no check, 0 is infer from first row, and > 0 is explicit length
Payee int // The payee field index
ProcessingAccount string // The account this export/CSV pertains to
Separator rune // The csv file separator
Skip int // The number of csv rows to skip, excluding blank lines
}
CsvConfig is the config for parsing the csv file
type Record ¶
type Record struct {
AccountIn string // The account in
AccountOut string // The account out
AmountIn string // The amount in
AmountOut string // The amount out
Comment string // The comment, if provided
Currency string // The currency
Date string // The date
Description string // The description, if present
Tags string // The tags, if present
Payee string // The payee
Raw string // The raw csv record
}
Record represents a financial transaction record
type TransactionRule ¶
type TransactionRule struct {
SetAccount string
SetComment string
MatchDescription string
MatchPayee string
SetDescription string
SetPayee string
SetTags string
}
TransactionRule is a set of values to match records with and update their values from
type TransactionsRulesConfig ¶
type TransactionsRulesConfig map[string]TransactionRule
TransactionsRulesConfig is a map of TransactionRule objects
Click to show internal directories.
Click to hide internal directories.