Documentation
¶
Index ¶
- func CreateDefaultHTTPClient() (*http.Client, error)
- type Account
- type AccountService
- type Category
- type CategoryService
- type Client
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Get(url string) (*http.Request, error)
- func (c *Client) Login(username string, password string) error
- func (c *Client) Logout() error
- func (c *Client) NewRequest(method string, endpointURL string, body *url.Values) (*http.Request, error)
- func (c *Client) Post(url string, body *url.Values) (*http.Request, error)
- type Transaction
- type TransactionService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultHTTPClient ¶
CreateDefaultHTTPClient creates default HTTP with cookie jar.
Types ¶
type Account ¶
type Account struct { ID int64 `json:"id"` Title string `json:"title"` Currency string `json:"currency"` }
Account represents payment account.
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
AccountService provides methods for working with payment accounts.
func (*AccountService) GetAccounts ¶
func (s *AccountService) GetAccounts() ([]Account, error)
GetAccounts lists accounts for current user.
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
CategoryService provides methods for working with categories.
func (*CategoryService) GetCategories ¶
func (s *CategoryService) GetCategories() ([]Category, error)
GetCategories lists categories for current user.
type Client ¶
type Client struct { // base url for all requests BaseURL *url.URL // user agent header UserAgent string // services Categories *CategoryService Accounts *AccountService Transactions *TransactionService // contains filtered or unexported fields }
Client represents savey client.
type Transaction ¶
type Transaction struct { ID int64 `json:"id"` Title string `json:"title"` Date time.Time `json:"date"` CategoryID int64 `json:"category_id"` AccountID int64 `json:"account_id"` Value float64 `json:"value"` Currency string `json:"currency"` Expense bool `json:"expense"` }
Transaction represents payment transaction.
type TransactionService ¶
type TransactionService struct {
// contains filtered or unexported fields
}
TransactionService provides methods for working with payment transactions.
func (*TransactionService) GetAccountTransactions ¶
func (s *TransactionService) GetAccountTransactions(acc Account) ([]Transaction, error)
GetAccountTransactions lists transactions for given account.
func (*TransactionService) GetTransactions ¶
func (s *TransactionService) GetTransactions(accounts []Account) ([]Transaction, error)
GetTransactions lists transactions for given accounts.
Click to show internal directories.
Click to hide internal directories.