package pfin
import "git.sr.ht/~mendelmaleh/pfin"
Index ¶
- func Filetype(parser string) (string, error)
- func Register(name string, parser Parser)
- type Account
- type Config
- type ErrUnregisteredParser
- type Parser
- type Transaction
Functions ¶
func Filetype ¶
func Register ¶
Types ¶
type Account ¶
type Account struct { Name string // parser type, inherited from account name if unset Type string // folder path from root, inherited from account name if unset Path string // default user, inherited from config.Pfin.User if unset DefaultUser string `toml:"user"` // map of users to card identifier Users map[string][]string // generated Cards map[string]string }
func (Account) User ¶
type Config ¶
type Config struct { Pfin struct { User string Root string } // the map is nice in the toml config, but not that nice for usability Account map[string]Account Accounts []string }
func ParseConfig ¶
ParseConfig will use default config location if path is empty
type ErrUnregisteredParser ¶
type ErrUnregisteredParser struct {
// contains filtered or unexported fields
}
func (ErrUnregisteredParser) Error ¶
func (e ErrUnregisteredParser) Error() string
type Parser ¶
type Parser interface { Filetype() string Parse(acc Account, filename string, data []byte) ([]Transaction, error) }
type Transaction ¶
type Transaction interface { Date() time.Time Amount() float64 // positive for debit, negative for credit Name() string Category() string Card() string // may be empty User() string Account() string // should be util.FormatTx String() string }
func Parse ¶
func Parse(acc Account, filename string, data []byte) ([]Transaction, error)
Source Files ¶
parser.go transaction.go types.go
Directories ¶
- Version
- v0.0.0-20240211185340-c44b6515a97b (latest)
- Published
- Feb 11, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 3 weeks ago –
Tools for package owners.