HeartbeatEvent.go 339 B

1234567891011121314151617181920
  1. package response
  2. import (
  3. "encoding/xml"
  4. )
  5. type HeartEvent struct {
  6. XMLName xml.Name `xml:"heartbeat"`
  7. AccountId int64 `xml:"accountId"`
  8. Token string `xml:"token"`
  9. }
  10. func NewHeartbeatEvent(data string) *HeartEvent {
  11. r := HeartEvent{}
  12. err := xml.Unmarshal([]byte(data), &r)
  13. if err != nil {
  14. return nil
  15. }
  16. return &r
  17. }