Documentation
¶
Index ¶
- Constants
- func LedgerAccountName(a Account) string
- func ValidateAccount(account Account) error
- func ValidateInstitution(inst Institution) error
- func ValidatePartialAccount(account interface{ ... }) error
- type Account
- type BasicAccount
- type BasicInstitution
- type Institution
- type LedgerAccountFormat
- type TransactionParser
Constants ¶
const ( // Uncategorized is used as the default account2 on an imported transaction Uncategorized = "uncategorized" // Ledger account types AssetAccount = "assets" LiabilityAccount = "liabilities" ExpenseAccount = "expenses" RevenueAccount = "revenues" // RedactSuffixLength the number of characters that remain unredacted at the end of a redacted string RedactSuffixLength = 4 // RedactPrefixLength the number of stars at the end beginning of a redacted string RedactPrefixLength = 4 )
Variables ¶
This section is empty.
Functions ¶
func LedgerAccountName ¶
LedgerAccountName returns a suitable account name for a ledger file
func ValidateAccount ¶
func ValidateInstitution ¶
func ValidateInstitution(inst Institution) error
func ValidatePartialAccount ¶
Types ¶
type Account ¶
type Account interface { Description() string ID() string Institution() Institution Type() string }
Account identifies an account at a financial institution
type BasicAccount ¶
type BasicAccount struct { AccountDescription string AccountID string AccountType string BasicInstitution BasicInstitution }
func (*BasicAccount) Description ¶
func (b *BasicAccount) Description() string
func (*BasicAccount) ID ¶
func (b *BasicAccount) ID() string
func (*BasicAccount) Institution ¶
func (b *BasicAccount) Institution() Institution
func (*BasicAccount) Type ¶
func (b *BasicAccount) Type() string
Type returns the ledger account type, such as 'assets' or 'liabilities'
type BasicInstitution ¶
BasicInstitution includes the bare minimum information to implement an institution Typically used for adding accounts via OFX imports
func (BasicInstitution) Description ¶
func (i BasicInstitution) Description() string
Description implements Institution
type Institution ¶
Institution represents the connection and identification details for a financial institution
type LedgerAccountFormat ¶
type LedgerAccountFormat struct { AccountType string Institution string AccountID string Remaining string }
LedgerAccountFormat represents an account's structured name for a ledger account format
func LedgerFormat ¶
func LedgerFormat(a Account) *LedgerAccountFormat
LedgerFormat parses the account and returns a ledger account format
func ParseLedgerFormat ¶
func ParseLedgerFormat(account string) (*LedgerAccountFormat, error)
ParseLedgerFormat parses the given account string as a ledger account
func (*LedgerAccountFormat) String ¶
func (l *LedgerAccountFormat) String() string