Documentation ¶
Overview ¶
Package mapmyride provides a client and types for working with the MapMyRide (https://www.mapmyride.com) service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // HTTPDo is used to make HTTP requests, if provided. // Otherwise, http.DefaultClient.Do is used. HTTPDo func(*http.Request) (*http.Response, error) // contains filtered or unexported fields }
Client is a client for the MapMyRide service.
func NewClient ¶
func NewClient(tokenSource TokenSource) *Client
NewClient returns a new Client using the given tokenSource.
type StaticTokenSource ¶
type StaticTokenSource string
StaticTokenSource is a TokenSource which always returns the underlying string.
func (StaticTokenSource) Token ¶
func (s StaticTokenSource) Token() (Token, error)
type Token ¶
type Token struct {
Token string
}
Token is a token used for authentication.
In the future it may be expanded to support an expiry.
type TokenSource ¶
TokenSource provides a Token.
type Workout ¶
type Workout struct { ID int Name string Kind string ActivityType string Kcal int Distance float64 // meters Speed float64 // meters per second Duration time.Duration StepCount int Gain int // meters StartedAt time.Time CreatedAt time.Time UpdatedAt time.Time Distances []WorkoutDistance Positions []WorkoutPosition Speeds []WorkoutSpeed Steps []WorkoutStep }
Workout is a recorded workout.
type WorkoutDistance ¶
WorkoutDistance is a point in time distance measurement for a workout, in meters.
Note that Elapsed may not necessarily track wall clock time from the workout's start time due to pauses during the workout.
type WorkoutPosition ¶
type WorkoutPosition struct { Elapsed time.Duration Elevation float64 // meters Lat float64 Lng float64 }
WorkoutPosition is a point in time position record for a workout. Elevation is in meters.
Note that Elapsed may not necessarily track wall clock time from the workout's start time due to pauses during the workout.
type WorkoutSpeed ¶
WorkoutSpeed is a point in time speed measurement for a workout.
Note that Elapsed may not necessarily track wall clock time from the workout's start time due to pauses during the workout.
type WorkoutStep ¶
WorkoutSpeed is a point in time step count measurement for a workout.
Note that Elapsed may not necessarily track wall clock time from the workout's start time due to pauses during the workout.