Documentation ¶
Overview ¶
Package mono - is MonoBank API client https://api.monobank.ua/docs/
Index ¶
- type Account
- type Accounts
- type Authorizer
- type Client
- func (c Client) ClientInfo(ctx context.Context) (*ClientInfo, error)
- func (c Client) Currency(ctx context.Context) (Currencies, error)
- func (c Client) SetWebHook(ctx context.Context, uri string) error
- func (c Client) Transactions(ctx context.Context, accountID string, from, to time.Time) (Transactions, error)
- func (c Client) WithAuth(auth Authorizer) Client
- func (c Client) WithBaseURL(uri string) Client
- type ClientInfo
- type Currencies
- type Currency
- type PersonalAPI
- type PersonalAuthorizer
- type PublicAPI
- type PublicAuthorizer
- type Time
- type Transaction
- type Transactions
- type WebHookData
- type WebHookRequest
- type WebHookResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) ClientInfo ¶
func (c Client) ClientInfo(ctx context.Context) (*ClientInfo, error)
func (Client) Transactions ¶ added in v0.2.0
func (c Client) Transactions(ctx context.Context, accountID string, from, to time.Time) ( Transactions, error)
TODO: make `to` optional
func (Client) WithAuth ¶
func (c Client) WithAuth(auth Authorizer) Client
WithAuth returns copy of Client with authorizer
func (Client) WithBaseURL ¶
WithAuth returns copy of Client with overridden baseURL
type ClientInfo ¶
ClientInfo - client/user info
type Currencies ¶
type Currencies []Currency
type PersonalAPI ¶ added in v0.2.0
type PersonalAPI interface { PublicAPI // ClientInfo - https://api.monobank.ua/docs/#/definitions/UserInfo ClientInfo(context.Context) (*ClientInfo, error) // Transactions - gets bank account statements(transations) // https://api.monobank.ua/docs/#/definitions/StatementItems Transactions(ctx context.Context, accountID string, from, to time.Time) (Transactions, error) // SetWebHook - sets webhook for statements SetWebHook(ctx context.Context, uri string) error }
type PersonalAuthorizer ¶
type PersonalAuthorizer struct {
// contains filtered or unexported fields
}
func NewPersonalAuthorizer ¶
func NewPersonalAuthorizer(token string) PersonalAuthorizer
func (PersonalAuthorizer) SetAuth ¶
func (a PersonalAuthorizer) SetAuth(req *http.Request)
type PublicAPI ¶ added in v0.2.0
type PublicAPI interface { // Currency https://api.monobank.ua/docs/#/definitions/CurrencyInfo Currency(context.Context) (Currencies, error) }
type PublicAuthorizer ¶
type PublicAuthorizer struct{}
func NewPublicAuthorizer ¶
func NewPublicAuthorizer() PublicAuthorizer
func (PublicAuthorizer) SetAuth ¶
func (a PublicAuthorizer) SetAuth(req *http.Request)
type Time ¶
func (*Time) UnmarshalJSON ¶
type Transaction ¶ added in v0.2.0
type Transaction struct { ID string `json:"id"` Time Time `json:"time"` Description string `json:"description"` MCC int32 `json:"mcc"` Hold bool `json:"hold"` Amount int64 `json:"amount"` OperationAmount int64 `json:"operationAmount"` CurrencyCode int `json:"currencyCode"` CommissionRate int64 `json:"commissionRate"` CashbackAmount int64 `json:"cashbackAmount"` Balance int64 `json:"balance"` Comment string `json:"comment"` }
Transaction - bank account statement
type WebHookData ¶
type WebHookData struct { AccountID string `json:"account"` // TODO: rename to Transaction: Statement Transaction `json:"statementItem"` }
type WebHookRequest ¶
type WebHookRequest struct {
WebHookURL string `json:"webHookUrl"`
}
type WebHookResponse ¶
type WebHookResponse struct { Type string `json:"type"` // "StatementItem" Data WebHookData `json:"data"` }
Click to show internal directories.
Click to hide internal directories.