Documentation
¶
Index ¶
Constants ¶
View Source
const ( ServerURL = "https://api.up.com.au/api/v1" BaseUnitDivisor = 100 // amounts are in cents )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) (*Client, error)
NewClient returns a Client It will use a default slog.Logger log handler unless overriden with WithLogger
func (*Client) GetAccounts ¶
func (*Client) GetTransactions ¶
func (c *Client) GetTransactions(ctx context.Context, params *oapi.GetTransactionsParams) ([]oapi.TransactionResource, error)
GetTransactions returns transactions for all accounts, optionally filtered by oapi.GetTransactionsParams.
type ClientOption ¶ added in v0.2.0
type ClientOption func(*Client)
func WithLogger ¶ added in v0.2.0
func WithLogger(logger *slog.Logger) ClientOption
WithLogger allows the user to define how log emitted by upgo will be handled. Upgo does not emit log otherwise.
func WithToken ¶ added in v0.2.0
func WithToken(token string) ClientOption
WithToken is used to supply an API auth token to upgo.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
fetch_transactions
command
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. |
|
report_expense_by_category
command
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. |
|
internal
|
|
|
Package oapi provides primitives to interact with the openapi HTTP API.
|
Package oapi provides primitives to interact with the openapi HTTP API. |
Click to show internal directories.
Click to hide internal directories.