dbapi

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize() string

Authorize checks the current token and returns an authorization URL if necessary.

func AuthorizedHandler

func AuthorizedHandler(w http.ResponseWriter, r *http.Request)

AuthorizedHandler handles the oauth HTTP response.

func CheckParams added in v0.9.0

func CheckParams() (bool, error)

CheckParams ensures that all parameters are provided and fails hard if not.

func SetCurrentToken

func SetCurrentToken(token *oauth2.Token)

SetCurrentToken sets the currently active token. Mostly useful for tests.

func UpdateToken

func UpdateToken(code string) error

UpdateToken updates the current token using an update code.

Types

type DbCashConnector

type DbCashConnector struct{}

DbCashConnector gets transactions from a DB Cash account and converts to YNAB format.

func (DbCashConnector) Authorize

func (connector DbCashConnector) Authorize() string

Authorize checks the current token and returns an authorization URL if necessary.

func (DbCashConnector) AuthorizedHandler

func (connector DbCashConnector) AuthorizedHandler(w http.ResponseWriter, r *http.Request)

AuthorizedHandler handles the oauth HTTP response.

func (DbCashConnector) CheckParams added in v0.9.0

func (connector DbCashConnector) CheckParams() (bool, error)

CheckParams ensures that all parameters are provided.

func (DbCashConnector) ConvertCashTransactionsToYNAB

func (connector DbCashConnector) ConvertCashTransactionsToYNAB(incomingTransactions DbCashTransactionsList, ynabAccountID string) (convertedTransactions []ynabTransaction)

ConvertCashTransactionsToYNAB converts a JSON string of transactions to YNAB format.

func (DbCashConnector) ConvertTransactionToYNAB

func (connector DbCashConnector) ConvertTransactionToYNAB(accountNumber string, incomingTransaction DbCashTransaction) ynabTransaction

ConvertTransactionToYNAB converts a given transaction to YNAB format.

func (DbCashConnector) GetTransactions

func (connector DbCashConnector) GetTransactions(accountNumber string) ([]ynabTransaction, error)

GetTransactions gets transactions from DB and returns them in YNAB format.

func (DbCashConnector) IsValidAccountNumber

func (connector DbCashConnector) IsValidAccountNumber(accountNumber string) (bool, error)

IsValidAccountNumber validates that the account number can be processed by this interface.

type DbCashTransaction

type DbCashTransaction struct {
	BookingDate      string
	CounterPartyName string
	PaymentReference string
	ID               string
	Amount           float32
}

DbCashTransaction represents a transaction from a cash account.

type DbCashTransactionsList

type DbCashTransactionsList struct {
	Transactions []DbCashTransaction
}

DbCashTransactionsList is a list of cash transactions as returned by the DB API.

type DbCreditCard

type DbCreditCard struct {
	TechnicalID string
	SecurePAN   string
}

DbCreditCard is a credit card.

type DbCreditCardsList

type DbCreditCardsList struct {
	Items []DbCreditCard
}

DbCreditCardsList is a list of credit cards as returned by the DB API.

type DbCreditConnector

type DbCreditConnector struct{}

DbCreditConnector is the connector for DB Credit card accounts.

func (DbCreditConnector) Authorize

func (connector DbCreditConnector) Authorize() string

Authorize checks the current token and returns an authorization URL if necessary.

func (DbCreditConnector) AuthorizedHandler

func (connector DbCreditConnector) AuthorizedHandler(w http.ResponseWriter, r *http.Request)

AuthorizedHandler handles the oauth HTTP response.

func (DbCreditConnector) CheckParams added in v0.9.0

func (connector DbCreditConnector) CheckParams() (bool, error)

CheckParams ensures that all parameters are provided.

func (DbCreditConnector) ConvertCreditTransactionsToYNAB

func (connector DbCreditConnector) ConvertCreditTransactionsToYNAB(incomingTransactions DbCreditTransactionsList) []ynabTransaction

ConvertCreditTransactionsToYNAB converts a JSON string of transactions to YNAB format.

func (DbCreditConnector) GetCreditTransactions

func (connector DbCreditConnector) GetCreditTransactions(last4 string) (transactions DbCreditTransactionsList, err error)

GetCreditTransactions gets transactions from a credit card.

func (DbCreditConnector) GetTransactions

func (connector DbCreditConnector) GetTransactions(accountnumber string) ([]ynabTransaction, error)

GetTransactions gets transactions from DB and returns them in YNAB format.

func (DbCreditConnector) IsValidAccountNumber

func (connector DbCreditConnector) IsValidAccountNumber(accountNumber string) (bool, error)

IsValidAccountNumber validates that the account number can be processed by this interface.

type DbCreditTransaction

type DbCreditTransaction struct {
	BookingDate             string
	ReasonForPayment        string
	AmountInAccountCurrency struct {
		Amount float32
	}
}

DbCreditTransaction represents a transaction from a credit card account.

type DbCreditTransactionsList

type DbCreditTransactionsList struct {
	Items []DbCreditTransaction
}

DbCreditTransactionsList is a list of cash transactions as returned by the DB API.

Jump to

Keyboard shortcuts

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