-
Notifications
You must be signed in to change notification settings - Fork 0
/
correlation.go
41 lines (34 loc) · 1.03 KB
/
correlation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package healthkit
import (
"encoding/xml"
"fmt"
"time"
)
type Correlation struct {
XMLName xml.Name `xml:"Correlation"`
Type string `xml:"type,attr"`
SourceName string `xml:"sourceName,attr"`
SourceVersion string `xml:"sourceVersion,attr"`
Device string `xml:"device,attr"`
CreationDate string `xml:"creationDate,attr"`
StartDate string `xml:"startDate,attr"`
EndDate string `xml:"endDate,attr"`
MetadataEntry []*MetadataEntry `xml:"MetadataEntry"`
Record []*Record `xml:"Record"`
}
func (c *Correlation) String() string {
return fmt.Sprint(*c)
}
func (c *Correlation) CreationDateTime() time.Time {
t, _ := time.Parse(timeFormat, c.CreationDate)
return t
}
func (c *Correlation) StartDateTime() time.Time {
t, _ := time.Parse(timeFormat, c.StartDate)
return t
}
func (c *Correlation) EndDateTime() time.Time {
t, _ := time.Parse(timeFormat, c.EndDate)
return t
}
var _ Data = (*Correlation)(nil)