1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-06-20 16:08:38 -04:00

Make Client an interface instead of a struct

This makes it easier to maintain per-institution hacks that start
interacting with each other if you try to do them all in the same client
code. This commit also breaks out the existing Vanguard hack into its
own Client implementation.
This commit is contained in:
2018-10-03 09:59:04 -04:00
parent eb35a26986
commit d8491bed1d
5 changed files with 230 additions and 149 deletions

View File

@ -126,12 +126,13 @@ func tryProfile(appID, appVer, version string, noindent bool) bool {
fmt.Println("Error creating new OfxVersion enum:", err)
os.Exit(1)
}
var client = ofxgo.BasicClient{
AppID: appID,
AppVer: appVer,
SpecVersion: ver,
NoIndent: noindent,
}
var client = ofxgo.GetClient(serverURL,
&ofxgo.BasicClient{
AppID: appID,
AppVer: appVer,
SpecVersion: ver,
NoIndent: noindent,
})
var query ofxgo.Request
query.URL = serverURL

View File

@ -12,12 +12,13 @@ func newRequest() (ofxgo.Client, *ofxgo.Request) {
fmt.Println("Error creating new OfxVersion enum:", err)
os.Exit(1)
}
var client = ofxgo.BasicClient{
AppID: appID,
AppVer: appVer,
SpecVersion: ver,
NoIndent: noIndentRequests,
}
var client = ofxgo.GetClient(serverURL,
&ofxgo.BasicClient{
AppID: appID,
AppVer: appVer,
SpecVersion: ver,
NoIndent: noIndentRequests,
})
var query ofxgo.Request
query.URL = serverURL
@ -27,5 +28,5 @@ func newRequest() (ofxgo.Client, *ofxgo.Request) {
query.Signon.Org = ofxgo.String(org)
query.Signon.Fid = ofxgo.String(fid)
return &client, &query
return client, &query
}