Documentation ¶
Index ¶
- type CurrencyInfo
- type CurrencyInfos
- type MonobankClient
- func (mc *MonobankClient) GetBankCurrency() (*CurrencyInfos, error)
- func (mc *MonobankClient) GetClientInfo() (*UserInfo, error)
- func (mc *MonobankClient) GetPersonalStatements(account string, from, to int64) (*StatementItems, error)
- func (mc *MonobankClient) GetPersonalStatementsTillNow(account string, from int64) (*StatementItems, error)
- func (mc *MonobankClient) SetWebhook(webhookURL string) error
- type StatementItem
- type StatementItems
- type UserAccount
- type UserAccounts
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrencyInfo ¶
type CurrencyInfo struct { CurrencyCodeA int32 `json:"currencyCodeA"` CurrencyCodeB int32 `json:"currencyCodeB"` Date int32 `json:"date"` RateSell float64 `json:"rateSell"` RateBuy float64 `json:"rateBuy"` RateCross float64 `json:"rateCross"` }
CurrencyInfo describes the one-pair currency information.
type CurrencyInfos ¶
type CurrencyInfos []CurrencyInfo
CurrencyInfos describes list of currency info.
type MonobankClient ¶
type MonobankClient struct { // Token is monobank access token. Token string // contains filtered or unexported fields }
MonobankClient holds data about monobank client.
func NewMonobankClient ¶ added in v0.1.1
func NewMonobankClient(token string) *MonobankClient
NewMonobankClient returns new MonobankClient.
func (*MonobankClient) GetBankCurrency ¶
func (mc *MonobankClient) GetBankCurrency() (*CurrencyInfos, error)
GetBankCurrency returns all available currency infos.
func (*MonobankClient) GetClientInfo ¶
func (mc *MonobankClient) GetClientInfo() (*UserInfo, error)
GetClientInfo returns all available info about the client.
func (*MonobankClient) GetPersonalStatements ¶
func (mc *MonobankClient) GetPersonalStatements(account string, from, to int64) (*StatementItems, error)
GetPersonalStatements returns all transaction by the given account in the particular period of time.
func (*MonobankClient) GetPersonalStatementsTillNow ¶
func (mc *MonobankClient) GetPersonalStatementsTillNow(account string, from int64) (*StatementItems, error)
GetPersonalStatementsTillNow returns all transaction by the given account in the particular period of time. It uses GetPersonalStatements but defines `to` param as now time.
func (*MonobankClient) SetWebhook ¶ added in v0.1.1
func (mc *MonobankClient) SetWebhook(webhookURL string) error
SetWebhook sets webhook for monobank to send events.
type StatementItem ¶
type StatementItem struct { ID string `json:"id"` Time int32 `json:"time"` Description string `json:"description"` Mcc int32 `json:"mcc"` Hold bool `json:"hold"` Amount int64 `json:"amount"` OperationAmount int64 `json:"operationAmount"` CurrencyCode int32 `json:"currencyCode"` CommissionRate int64 `json:"commissionRate"` CashbackAmount int64 `json:"cashbackAmount"` Balance int64 `json:"balance"` }
StatementItem describes the transaction in the particular point in time.
type StatementItems ¶
type StatementItems []StatementItem
StatementItems describes list of statement items.
type UserAccount ¶
type UserAccount struct { ID string `json:"id"` Balance int64 `json:"balance"` CreditLimit int64 `json:"creditLimit"` CurrencyCode int32 `json:"currencyCode"` CashbackType string `json:"cashbackType"` // TODO: make it enum }
UserAccount describes the client's account.
type UserInfo ¶
type UserInfo struct { Name string `json:"name"` WebHookURL string `json:"webHookUrl"` Accounts UserAccounts `json:"accounts"` }
UserInfo describes the client.