forked from strava/go.strava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
efforts.go
33 lines (29 loc) · 1.01 KB
/
efforts.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
package strava
import (
"time"
)
// EffortSummary is the base object for BestEfforts, SegmentEfforts and LapEfforts
type EffortSummary struct {
Id int64 `json:"id"`
Name string `json:"name"`
Activity struct {
Id int64 `json:"id"`
} `json:"activity"`
Athlete struct {
Id int64 `json:"id"`
} `json:"athlete"`
Distance float64 `json:"distance"`
MovingTime int `json:"moving_time"`
ElapsedTime int `json:"elapsed_time"`
StartIndex int `json:"start_index"`
EndIndex int `json:"end_index"`
StartDate time.Time `json:"-"`
StartDateLocal time.Time `json:"-"`
StartDateString string `json:"start_date"`
StartDateLocalString string `json:"start_date_local"`
}
/*********************************************************/
func (e *EffortSummary) postProcessSummary() {
e.StartDate, _ = time.Parse(timeFormat, e.StartDateString)
e.StartDateLocal, _ = time.Parse(timeFormat, e.StartDateLocalString)
}