Documentation ¶
Index ¶
- Variables
- type Campaign
- type Category
- type CategoryType
- type Client
- func (c Client) AddTransaction(t TransactionInput) (map[string]interface{}, error)
- func (c Client) GetCategories(walletID string) ([]Category, error)
- func (c Client) GetTransactions(walletID string, startDate, endDate time.Time) ([]Transaction, error)
- func (c Client) GetUserInfo() (UserInfo, error)
- func (c Client) GetWallets() ([]Wallet, error)
- func (c *Client) Refresh() error
- func (c Client) String() string
- type Transaction
- type TransactionInput
- type UserInfo
- type Wallet
Constants ¶
This section is empty.
Variables ¶
var DebugPayload = false
DebugPayload can be set to `true` to debug HTTP payloads.
Functions ¶
This section is empty.
Types ¶
type Campaign ¶
type Campaign struct { ID string `json:"_id"` Name string `json:"name"` Icon string `json:"icon"` Type int `json:"type"` StartAmount int `json:"start_amount"` GoalAmount int `json:"goal_amount"` Owner string `json:"owner"` EndDate time.Time `json:"end_date"` LastEditBy string `json:"lastEditBy"` TokenDevice string `json:"tokenDevice"` CurrencyID int `json:"currency_id"` IsPublic bool `json:"isPublic"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` IsDelete bool `json:"isDelete"` Status bool `json:"status"` }
Campaign contains an information about an event.
type Category ¶
type Category struct { ID string `json:"_id"` Icon string `json:"icon"` Metadata string `json:"metadata"` Name string `json:"name"` Type CategoryType `json:"type"` }
Category contains an information about transaction category.
type CategoryType ¶
type CategoryType int
CategoryType defines two types of categories, income or expense.
const ( // CategoryTypeIncome is income. CategoryTypeIncome CategoryType = iota + 1 // CategoryTypeExpense is expense. CategoryTypeExpense )
func (CategoryType) String ¶
func (t CategoryType) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a way to communicate with moneylover.
func (Client) AddTransaction ¶
func (c Client) AddTransaction(t TransactionInput) (map[string]interface{}, error)
AddTransaction adds the given transaction.
func (Client) GetCategories ¶
GetCategories retrieves a list of Category(s) in the given wallet.
func (Client) GetTransactions ¶
func (c Client) GetTransactions(walletID string, startDate, endDate time.Time) ([]Transaction, error)
GetTransactions retrieves a list of Transaction(s).
func (Client) GetUserInfo ¶
GetUserInfo retrieves UserInfo for the logged in user.
func (Client) GetWallets ¶
GetWallets retrieves a list of Wallet(s).
type Transaction ¶
type Transaction struct { ID string `json:"_id"` Note string `json:"note"` Account *Wallet `json:"account"` Category *Category `json:"category"` Amount float64 `json:"amount"` Date time.Time `json:"displayDate"` Images []string `json:"images"` ExcludeReport bool `json:"exclude_report"` Campaigns []Campaign `json:"campaign"` With []string `json:"with"` }
Transaction is an income or an expense entry in moneylover.
func (Transaction) String ¶
func (t Transaction) String() string
type TransactionInput ¶
type TransactionInput struct { Note string `json:"note"` Account string `json:"account"` Category string `json:"category"` Amount float64 `json:"amount"` Date time.Time `json:"displayDate"` }
TransactionInput is an income or an expense entry to be posted to moneylover.
func (TransactionInput) String ¶
func (t TransactionInput) String() string
type UserInfo ¶
type UserInfo struct { ID string `json:"_id"` DeviceID string `json:"deviceId"` Email string `json:"email"` IconPackage []string `json:"icon_package"` Purchased bool `json:"purchased"` }
UserInfo contains an information about the logged in user.
type Wallet ¶
type Wallet struct { ID string `json:"_id"` Name string `json:"name"` CurrencyID int `json:"currency_id"` Owner string `json:"owner"` TransactionNotification bool `json:"transaction_notification"` Archived bool `json:"archived"` AccountType int `json:"account_type"` ExcludeTotal bool `json:"exclude_total"` Icon string `json:"icon"` ListUser []struct { ID string `json:"_id"` Name string `json:"name"` } `json:"listUser"` UpdateAt time.Time `json:"updateAt"` IsDelete bool `json:"isDelete"` Balance []map[string]string `json:"balance"` }
Wallet contains an information about wallet.