1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-07-04 04:48:38 -04:00

Add Type() to Message interface, check types when marshalling requests

This commit is contained in:
2017-03-31 09:25:07 -04:00
parent 85684883c6
commit d822179446
8 changed files with 170 additions and 11 deletions

View File

@ -37,6 +37,10 @@ func (r *SecListRequest) Valid() (bool, error) {
return true, nil
}
func (r *SecListRequest) Type() messageType {
return SecListRq
}
type SecListResponse struct {
XMLName xml.Name `xml:"SECLISTTRNRS"`
TrnUID UID `xml:"TRNUID"`
@ -55,6 +59,10 @@ func (r SecListResponse) Valid() (bool, error) {
return true, nil
}
func (r SecListResponse) Type() messageType {
return SecListRs
}
type Security interface {
SecurityType() string
}
@ -176,6 +184,10 @@ func (r SecurityList) Valid() (bool, error) {
return true, nil
}
func (r SecurityList) Type() messageType {
return SecListRs
}
func (r *SecurityList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
for {
tok, err := nextNonWhitespaceToken(d)