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:
@ -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)
|
||||
|
Reference in New Issue
Block a user