1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2024-11-22 11:30:05 -05:00

Improve comments

This commit is contained in:
Aaron Lindsay 2017-03-16 11:14:58 -04:00
parent f0b67bad85
commit 073387b65b
2 changed files with 7 additions and 5 deletions

10
ofx.go
View File

@ -66,7 +66,7 @@ func RawRequest(URL string, r io.Reader) (*http.Response, error) {
} }
// Request marshals a Request object into XML, makes an HTTP request against // Request marshals a Request object into XML, makes an HTTP request against
// it's URL, and then unmarshals the response into a Reaponse object. // it's URL, and then unmarshals the response into a Response object.
// //
// Before being marshaled, some of the the Request object's values are // Before being marshaled, some of the the Request object's values are
// overwritten, namely those dictated by the Client's configuration (Version, // overwritten, namely those dictated by the Client's configuration (Version,
@ -107,7 +107,7 @@ type Message interface {
type Request struct { type Request struct {
URL string URL string
Version string // String for OFX header, defaults to 203 Version string // OFX version string, overwritten in Client.Request()
Signon SignonRequest //<SIGNONMSGSETV1> Signon SignonRequest //<SIGNONMSGSETV1>
Signup []Message //<SIGNUPMSGSETV1> Signup []Message //<SIGNUPMSGSETV1>
Banking []Message //<BANKMSGSETV1> Banking []Message //<BANKMSGSETV1>
@ -384,10 +384,12 @@ func (or *Response) readXMLHeaders(decoder *xml.Decoder) error {
return nil return nil
} }
// Number of bytes of response to read when attempting to figure out whether
// we're using OFX or SGML
const guessVersionCheckBytes = 1024 const guessVersionCheckBytes = 1024
// Defaults to XML if it can't determine the version based on the first 1024 // Defaults to XML if it can't determine the version or if there is any
// bytes, or if there is any ambiguity // ambiguity
func guessVersion(r *bufio.Reader) (bool, error) { func guessVersion(r *bufio.Reader) (bool, error) {
b, _ := r.Peek(guessVersionCheckBytes) b, _ := r.Peek(guessVersionCheckBytes)
if b == nil { if b == nil {

View File

@ -7,7 +7,7 @@ import (
type SignonRequest struct { type SignonRequest struct {
XMLName xml.Name `xml:"SONRQ"` XMLName xml.Name `xml:"SONRQ"`
DtClient Date `xml:"DTCLIENT"` // Overwritten in Client.Request() DtClient Date `xml:"DTCLIENT"` // Current time on client, overwritten in Client.Request()
UserId String `xml:"USERID"` UserId String `xml:"USERID"`
UserPass String `xml:"USERPASS,omitempty"` UserPass String `xml:"USERPASS,omitempty"`
UserKey String `xml:"USERKEY,omitempty"` UserKey String `xml:"USERKEY,omitempty"`