Documentation ¶
Index ¶
- func ParseMillidollars(millidollars int64) (int64, int16)
- func ToMillidollars(dollars int64, cents int16) int64
- type APIError
- type Client
- func (c *Client) Get(requestPath string) (*http.Response, error)
- func (c *Client) GetBudgets() ([]*model.Budget, error)
- func (c *Client) GetCategories(budget *model.Budget) ([]*model.BudgetCategoryGroup, error)
- func (c *Client) GetJSON(requestPath string, result interface{}) error
- func (c *Client) GetMonthlyAverageSpent(budget *model.Budget, category *model.BudgetCategory, monthLookback int) (int64, int16, error)
- func (c *Client) GetReadyToAssign(budget *model.Budget) (int64, int16, error)
- func (c *Client) Patch(requestPath string, requestBody io.Reader) (*http.Response, error)
- func (c *Client) PatchJSON(requestPath string, requestBody interface{}) error
- func (c *Client) SetBudget(budget *model.Budget, category *model.BudgetCategory, newDollars int64, ...) error
- type ErrorContainer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseMillidollars ¶ added in v0.4.1
ParseMillidollars parses the "millidollar" unit returned by YNAB into dollars and cents
func ToMillidollars ¶ added in v0.4.1
ToMillidollars converts the given dollars and cents to millidollars for YNAB's API
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetCategories ¶
func (*Client) GetJSON ¶
GetJSON issues a GET request for JSON data to the given request path and populates the given result with the body of the response
func (*Client) GetMonthlyAverageSpent ¶
func (*Client) GetReadyToAssign ¶ added in v0.4.1
func (*Client) Patch ¶
Patch issues a PATCH request to the given request path with the given request body
type ErrorContainer ¶
type ErrorContainer struct {
APIError *APIError `json:"error"`
}
func (*ErrorContainer) Error ¶
func (ec *ErrorContainer) Error() string
Click to show internal directories.
Click to hide internal directories.