ingaugo

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 22 Imported by: 0

README

ingaugo

Go Reference

A screenscraping interface to ING Australia Bank written in Go. It will drive a Chrome browser instance using the Chrome DevTools Protocol.

Usage

bank, err = ingaugo.NewBank(logger, *wsURL)
if err != nil {
	log.Fatal(err)
}

ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()

token, err := bank.Login(ctx, *clientNumber, *accessPin)
if err != nil {
	log.Fatal(err)
}

log.Printf("token: %s\n", token)

wsURL refers to an already running instance of Chrome browser such as headless-shell. If wsURL is nil then the package will attempt to launch Chrome browser locally by calling google-chrome executable.

Credit

Based on https://github.com/adamroyle/ing-au-login

Documentation

Overview

Package ingaugo provides a screenscraping interface to ING Australia Bank

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExposeFunc added in v0.1.5

func ExposeFunc(name string, f func(string)) dp.Action

Types

type Bank

type Bank struct {
	// contains filtered or unexported fields
}

func NewBank

func NewBank(logger *slog.Logger, websocketURL string) (*Bank, error)

NewBank is used to initialize and return a Bank if websocketURL is not empty, the package will connect to browser instances listing at that location otherwise, the package will attempt to launch a local browser instance. It depends on 'google-chrome' executable being in $PATH

func (*Bank) GetTransactionsDays added in v0.0.5

func (bank *Bank) GetTransactionsDays(days int, accountNumber, authToken string) (csv []byte, err error)

GetTransactionsDays fetches transactions for the last x days. It takes an account number and auth token and returns CSV data

func (*Bank) Login

func (bank *Bank) Login(ctx context.Context, clientNumber, accessPin string) (token string, err error)

Login takes a context, ING client number and access pin and returns an authentication token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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