Documentation ¶
Index ¶
- func Register(name string, driver Driver)
- func Search(query string) []string
- func Statement(connector Connector, start, end time.Time, accountIDs []string, ...) ([]ledger.Transaction, error)
- func Validate(account Account) error
- type Account
- type Action
- type Browser
- type BrowserConfig
- type Connector
- type ConnectorValidator
- type CredConnector
- type DownloadRequest
- type Downloader
- type Driver
- type PasswordConnector
- type Requestor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register adds a driver with the given name to the registry. Enables a call with Connect and the same driver name
Types ¶
type Account ¶
Account is a web connect enabled account
func UnmarshalAccount ¶
UnmarshalAccount attempts to unmarshal the given bytes into a known Web Connect account type
type Browser ¶
type Browser interface { // Run calls each action in order, stopping on the first error Run(ctx context.Context, actions ...Action) error // Download registers an asynchronous handler for any detected file downloads. // Ensure this is registered before Run is called. Download(downloader Downloader) // DownloadErr returns an error if one has occurred during a download. Always returns the first error. DownloadErr() error }
Browser manages a browser window, runs actions against it, and handles download requests
func NewBrowser ¶
func NewBrowser(ctx context.Context, config BrowserConfig) (Browser, error)
NewBrowser creates an instance of Browser with the given config options, bound to the provided context Canceling the context closes the browser entirely
type BrowserConfig ¶
type BrowserConfig struct { Debug bool NoHeadless bool Record bool Device chromedp.Device Logger *zap.Logger }
BrowserConfig passes options for a new browser constructor
type Connector ¶
type Connector interface { model.Institution CredConnector Requestor }
Connector downloads statements from an institution's website
func Connect ¶
func Connect(connector CredConnector) (Connector, error)
Connect creates a Connector with the given driver name and credentials
type ConnectorValidator ¶ added in v0.8.4
ConnectorValidator performs validation on an account / credential pair, returns any errors
type CredConnector ¶
type CredConnector interface { // Driver is the name of the driver Driver() string }
CredConnector is used by a Driver to create a full Connector
type DownloadRequest ¶
DownloadRequest contains a download request's details to help reconstruct your own download HTTP request
func (*DownloadRequest) Fetch ¶
func (d *DownloadRequest) Fetch(ctx context.Context) ([]byte, error)
Fetch downloads the file with the given download request details and returns the response body as bytes
func (*DownloadRequest) HTTPRequest ¶
HTTPRequest creates an *http.Request from this download's details
type Downloader ¶
type Downloader func(context.Context, DownloadRequest) error
Downloader receives a download request and processes it synchronously
type Driver ¶
type Driver func(CredConnector) (Connector, error)
type PasswordConnector ¶
type PasswordConnector interface { CredConnector Username() string Password() redactor.String SetPassword(redactor.String) }
PasswordConnector contains credentials for user/pass authentication
type Requestor ¶
type Requestor interface { // Statement downloads transactions with browser between the start and end times Statement(start, end time.Time, accountID string, browser Browser, prompt prompter.Prompter) (*ofxgo.Response, error) }
Requestor downloads statements from an institution's website