ingaugo

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 18 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 := ingaugo.NewBankWithWS(websocketURL)

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)

The websocketURL refers to an already running instance of Chrome browser such as headless-shell. Alternatively, use NewBank() and 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

This section is empty.

Types

type Bank

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

func NewBank

func NewBank() Bank

NewBank is used to initialize and return a Bank that works by launching a a local browser instance. It depends on 'google-chrome' executable being in $PATH

func NewBankWithWS added in v0.0.4

func NewBankWithWS(websocketURL string) Bank

NewBankWithWS initalises and returns a Bank that will attempt to connect to a browser via websocket URL of the form ws://<hostname>:<port>

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

func (*Bank) SetDebug added in v0.0.11

func (b *Bank) SetDebug(state bool)

SetDebug turns on/off verbose logging to stderr

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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