Documentation
¶
Index ¶
Constants ¶
View Source
const DateFormat = "2006-01-02"
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type AccountMap ¶
func (*AccountMap) Decode ¶
func (accountMap *AccountMap) Decode(value string) error
Decode implements `envconfig.Decoder` for AccountMap to decode JSON properly
type Config ¶
type Config struct { // DataDir is the path for storing files DataDir string `envconfig:"YNABBER_DATADIR" default:"."` // Debug prints more log statements Debug bool `envconfig:"YNABBER_DEBUG" default:"false"` // Interval is how often to execute the read/write loop, 0=run only once Interval time.Duration `envconfig:"YNABBER_INTERVAL" default:"6h"` // Readers is a list of sources to read transactions from. Currently only // Nordigen is supported. Readers []string `envconfig:"YNABBER_READERS" default:"nordigen"` // Writers is a list of destinations to write transactions to. Writers []string `envconfig:"YNABBER_WRITERS" default:"ynab"` // Reader and/or writer specific settings Nordigen Nordigen YNAB YNAB }
Config is loaded from the environment during execution with cmd/ynabber
type Milliunits ¶
type Milliunits int64
func MilliunitsFromAmount ¶
func MilliunitsFromAmount(amount float64) Milliunits
MilliunitsFromAmount returns a transaction amount in YNABs milliunits format
func (Milliunits) Negate ¶ added in v0.6.0
func (m Milliunits) Negate() Milliunits
Negate changes the sign of m to the opposite
func (Milliunits) String ¶
func (m Milliunits) String() string
type Nordigen ¶
type Nordigen struct { // BankID is used to create requisition BankID string `envconfig:"NORDIGEN_BANKID"` // SecretID is used to create requisition SecretID string `envconfig:"NORDIGEN_SECRET_ID"` // SecretKey is used to create requisition SecretKey string `envconfig:"NORDIGEN_SECRET_KEY"` // PayeeSource is a list of sources for Payee candidates, the first method // that yields a result will be used. Valid options are: unstructured, name // and additional. // // * unstructured: uses the `RemittanceInformationUnstructured` field // * name: uses either the either `debtorName` or `creditorName` field // * additional: uses the `AdditionalInformation` field PayeeSource []string `envconfig:"NORDIGEN_PAYEE_SOURCE" default:"unstructured,name,additional"` // PayeeStrip is a list of words to remove from Payee. For example: // "foo,bar" PayeeStrip []string `envconfig:"NORDIGEN_PAYEE_STRIP"` // TransactionID is the field to use as transaction ID. Not all banks use // the same field and some even change the ID over time. // // Valid options are: TransactionId, InternalTransactionId TransactionID string `envconfig:"NORDIGEN_TRANSACTION_ID" default:"TransactionId"` // RequisitionHook is a exec hook thats executed at various stages of the // requisition process. The hook is executed with the following arguments: // <status> <link> RequisitionHook string `envconfig:"NORDIGEN_REQUISITION_HOOK"` // RequisitionFile overrides the file used to store the requisition. This // file is placed inside the YNABBER_DATADIR. RequisitionFile string `envconfig:"NORDIGEN_REQUISITION_FILE"` }
Nordigen related settings
type Reader ¶ added in v0.7.0
type Reader interface {
Bulk() ([]Transaction, error)
}
type Transaction ¶
type TransactionStatus ¶ added in v0.8.0
type TransactionStatus string
const ( Cleared TransactionStatus = "cleared" Uncleared TransactionStatus = "uncleared" Reconciled TransactionStatus = "reconciled" )
func (*TransactionStatus) Decode ¶ added in v0.8.0
func (cs *TransactionStatus) Decode(value string) error
Decode implements `envconfig.Decoder` for TransactionStatus
func (TransactionStatus) String ¶ added in v0.8.0
func (cs TransactionStatus) String() string
type Writer ¶ added in v0.7.0
type Writer interface {
Bulk([]Transaction) error
}
type YNAB ¶
type YNAB struct { // BudgetID for the budget you want to import transactions into. You can // find the ID in the URL of YNAB: https://app.youneedabudget.com/<budget_id>/budget BudgetID string `envconfig:"YNAB_BUDGETID"` // Token is your personal access token as obtained from the YNAB developer // settings section Token string `envconfig:"YNAB_TOKEN"` // AccountMap of IBAN to YNAB account IDs in JSON. For example: // '{"<IBAN>": "<YNAB Account ID>"}' AccountMap AccountMap `envconfig:"YNAB_ACCOUNTMAP"` // FromDate only import transactions from this date and onward. For // example: 2006-01-02 FromDate Date `envconfig:"YNAB_FROM_DATE"` // Delay sending transaction to YNAB by this duration. This can be necessary // if the bank changes transaction IDs after some time. Default is 0 (no // delay). Delay time.Duration `envconfig:"YNAB_DELAY" default:"0"` // Set cleared status, possible values: cleared, uncleared, reconciled . // Default is uncleared for historical reasons but recommend setting this // to cleared because ynabber transactions are cleared by bank. // They'd still be unapproved until approved in YNAB. Cleared TransactionStatus `envconfig:"YNAB_CLEARED" default:"uncleared"` // SwapFlow changes inflow to outflow and vice versa for any account with a // IBAN number in the list. This maybe be relevant for credit card accounts. // // Example: "DK9520000123456789,NO8330001234567" SwapFlow []string `envconfig:"YNAB_SWAPFLOW"` }
YNAB related settings
type Ynabber ¶
func NewYnabber ¶ added in v0.8.2
NewYnabber creates a new Ynabber instance
Click to show internal directories.
Click to hide internal directories.