Documentation ¶
Index ¶
- Constants
- type Account
- type AccountID
- type Amount
- type Budget
- type BudgetID
- type Category
- type CategoryGroup
- type CategoryID
- type Client
- func (c *Client) GetAccounts(budgetID BudgetID) ([]Account, error)
- func (c *Client) GetBudgets() ([]Budget, error)
- func (c *Client) GetCategories(budgetID BudgetID) ([]CategoryGroup, error)
- func (c *Client) GetPayees(budgetID BudgetID) ([]Payee, error)
- func (c *Client) GetUser() (User, error)
- func (c *Client) PostTransactions(budgetID BudgetID, transactions []Transaction) error
- type Config
- type Error
- type HTTPClient
- type Payee
- type PayeeID
- type Token
- type Transaction
- type TransactionID
- type User
- type UserID
Constants ¶
View Source
const BaseURL = "api.youneedabudget.com/v1"
BaseURL is the default domain to use
View Source
const Scheme = "https://"
Scheme is what scheme is used to talkt to the api
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { ID CategoryID Name string Hidden bool }
Category is the model for a category
type CategoryGroup ¶
type CategoryGroup struct { ID CategoryID Name string Categories []Category }
CategoryGroup is a collection of Categories
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicates with the YNAB api
func (*Client) GetAccounts ¶
GetAccounts return all accounts for the budget
func (*Client) GetBudgets ¶
GetBudgets returns all Budgets for this user
func (*Client) GetCategories ¶
func (c *Client) GetCategories(budgetID BudgetID) ([]CategoryGroup, error)
GetCategories return all categories for the budget
func (*Client) PostTransactions ¶
func (c *Client) PostTransactions(budgetID BudgetID, transactions []Transaction) error
PostTransactions send transactions to YNAB
type Config ¶
type Config struct { Token Token Scheme string BaseURL string Client HTTPClient }
Config is how you want the client to work
type HTTPClient ¶
HTTPClient is the interface that is needed to reach the internet
type Transaction ¶
type Transaction struct { Account Account Date time.Time Amount Amount Payee Payee Category Category Memo string Cleared string Approved bool ID TransactionID }
Transaction is a transaction on the YNAB site
func (Transaction) MarshalJSON ¶
func (t Transaction) MarshalJSON() ([]byte, error)
MarshalJSON converts the struct to json
Click to show internal directories.
Click to hide internal directories.