Documentation ¶
Index ¶
- Constants
- Variables
- func ToReader[T NoopRequestBody | any](t T) (io.Reader, error)
- type AccountDetails
- type AccountDetailsResponse
- type AccountReauthorisation
- type AccountService
- type AuthorisationService
- type BaseMonoResponse
- type Client
- type ExchangeTokenRequest
- type ExchangeTokenResponse
- type FetchBalanceOptions
- type InflowResponse
- type NoopRequestBody
- type Option
- type OutflowResponse
- type ReauthorisationRequest
- type ReauthorisationRequestScope
- type ReauthorisationResponse
- type Response
- type Transaction
- type TransactionMetadata
- type TransactionService
- func (t *TransactionService) All(ctx context.Context, accountID string, opts TransactionsFilter) ([]Transaction, TransactionMetadata, error)
- func (t *TransactionService) Credits(ctx context.Context, accountID string) (InflowResponse, error)
- func (t *TransactionService) Debits(ctx context.Context, accountID string) (OutflowResponse, error)
- type TransactionType
- type TransactionsFilter
- type TransactionsResponse
Constants ¶
View Source
const ( // We do not use this internally but can be helpful for people who want to parse the date // correctly DateFormat = "02-01-2006" )
View Source
const (
Version = "0.1.0"
)
Variables ¶
View Source
var ErrInvalidTransactionType = errors.New("not a valid TransactionType")
Functions ¶
Types ¶
type AccountDetails ¶
type AccountDetails struct { Account struct { ID string `json:"id"` Name string `json:"name"` Currency string `json:"currency"` Type string `json:"type"` AccountNumber string `json:"account_number"` Balance int `json:"balance"` Bvn string `json:"bvn"` Institution struct { Name string `json:"name"` BankCode string `json:"bank_code"` Type string `json:"type"` } `json:"institution"` } `json:"account"` Meta struct { DataStatus string `json:"data_status"` AuthMethod string `json:"auth_method"` } `json:"meta"` }
type AccountDetailsResponse ¶
type AccountDetailsResponse struct { BaseMonoResponse Data AccountDetails `json:"data"` }
type AccountReauthorisation ¶
type AccountReauthorisation struct { string `json:"ref"` } `json:"meta"` }Ref
type AccountService ¶
type AccountService service
func (*AccountService) Balance ¶
func (a *AccountService) Balance(ctx context.Context, opts FetchBalanceOptions) (int64, error)
func (*AccountService) Details ¶
func (a *AccountService) Details(ctx context.Context, accountID string) (AccountDetails, error)
type AuthorisationService ¶
type AuthorisationService service
func (*AuthorisationService) ExchangeToken ¶
func (a *AuthorisationService) ExchangeToken(ctx context.Context, opts ExchangeTokenRequest) (string, error)
func (*AuthorisationService) Reauthorise ¶
func (a *AuthorisationService) Reauthorise(ctx context.Context, opts ReauthorisationRequest) (AccountReauthorisation, error)
type BaseMonoResponse ¶
type Client ¶
type Client struct { Account *AccountService Authorisation *AuthorisationService Transaction *TransactionService // contains filtered or unexported fields }
type ExchangeTokenRequest ¶
type ExchangeTokenRequest struct {
Code string `json:"code,omitempty"`
}
type ExchangeTokenResponse ¶
type ExchangeTokenResponse struct { BaseMonoResponse Data struct { ID string `json:"id,omitempty"` } `json:"data,omitempty"` }
type FetchBalanceOptions ¶
type InflowResponse ¶
type InflowResponse = heatmapResponse
type NoopRequestBody ¶
type NoopRequestBody struct{}
type Option ¶
type Option func(*Client)
func WithAPISecret ¶
func WithHTTPClient ¶
func WithUserAgent ¶
type OutflowResponse ¶
type OutflowResponse = heatmapResponse
type ReauthorisationRequest ¶
type ReauthorisationRequest struct { string `json:"ref,omitempty"` } `json:"meta,omitempty"` }Ref
type ReauthorisationRequestScope ¶
type ReauthorisationRequestScope string
ENUM(reauth)
const ( ReauthorisationRequestScope = "reauth" )ReauthorisationRequestScopeReauth
func ParseReauthorisationRequestScope ¶
func ParseReauthorisationRequestScope(name string) (ReauthorisationRequestScope, error)
ParseReauthorisationRequestScope attempts to convert a string to a ReauthorisationRequestScope.
func (ReauthorisationRequestScope) IsValid ¶
func (x ReauthorisationRequestScope) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ReauthorisationRequestScope) String ¶
func (x ReauthorisationRequestScope) String() string
String implements the Stringer interface.
type ReauthorisationResponse ¶
type ReauthorisationResponse struct {}
type Transaction ¶
type TransactionMetadata ¶
type TransactionService ¶
type TransactionService service
func (*TransactionService) All ¶
func (t *TransactionService) All(ctx context.Context, accountID string, opts TransactionsFilter) ([]Transaction, TransactionMetadata, error)
func (*TransactionService) Credits ¶
func (t *TransactionService) Credits(ctx context.Context, accountID string) ( InflowResponse, error)
func (*TransactionService) Debits ¶
func (t *TransactionService) Debits(ctx context.Context, accountID string) ( OutflowResponse, error)
type TransactionType ¶
type TransactionType string
ENUM(debit,credit)
const ( // TransactionTypeDebit is a TransactionType of type debit. TransactionTypeDebit TransactionType = "debit" // TransactionTypeCredit is a TransactionType of type credit. TransactionTypeCredit TransactionType = "credit" )
func ParseTransactionType ¶
func ParseTransactionType(name string) (TransactionType, error)
ParseTransactionType attempts to convert a string to a TransactionType.
func (TransactionType) IsValid ¶
func (x TransactionType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (TransactionType) String ¶
func (x TransactionType) String() string
String implements the Stringer interface.
type TransactionsFilter ¶
type TransactionsResponse ¶
type TransactionsResponse struct { BaseMonoResponse Data []Transaction `json:"data"` Meta TransactionMetadata `json:"meta"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.