upgo

package module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

README

Upgo

Go Reference

Upgo is a API client library for Up Bank Australia written in Go. Upgo provides these methods:

  • GetAccounts
  • GetTransactions

Upgo is a minimal wrapper around the complete API generated from the OpenAPI spec - see ./oapi. Users needing more advanced functionality should use ./oapi directly.

Usage

See example utility ./cmd/upgo/main.go.

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 (c *Client) GetAccounts(ctx context.Context) ([]oapi.AccountResource, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL