Documentation ¶
Index ¶
- Variables
- func CreateOauthConfig(oauthConfigFile string) (*oauth2.Config, error)
- func CreateStravaClient(sf *StravaFlags) (*strava3golang.APIClient, error)
- func CreateToken(tokenFile string) (*oauth2.Token, error)
- func GetActivitiesAndStreams(config *ActivitiesConfig, filter ActivityFilter) ([]util.Jsonable, error)
- func InitLogging(logFile string)
- func RetrieveActivities(config *ActivitiesConfig) ([]strava3golang.SummaryActivity, error)
- func RetrieveStreams(config *ActivitiesConfig, activityIds []int64) ([]*strava3golang.StreamSet, error)
- type AbridgedSummaryActivity
- type ActivitiesConfig
- type Activity
- type ActivityAndStream
- type ActivityFilter
- type IntSet
- type StravaFlags
- type StreamKind
Constants ¶
This section is empty.
Variables ¶
View Source
var AllStreamKinds []StreamKind = []StreamKind{ StreamTime, StreamDistance, StreamLatlng, StreamAltitude, StreamVelicitySmooth, StreamHeartrate, StreamCadence, StreamWatts, StreamTemp, StreamMoving, StreamGradeSmooth, }
View Source
var AllStreamKindsString []string = []string{ string(StreamTime), string(StreamDistance), string(StreamLatlng), string(StreamAltitude), string(StreamVelicitySmooth), string(StreamHeartrate), string(StreamCadence), string(StreamWatts), string(StreamTemp), string(StreamMoving), string(StreamGradeSmooth), }
Functions ¶
func CreateOauthConfig ¶
Create the oauth config used for all oauth requests
func CreateStravaClient ¶
func CreateStravaClient(sf *StravaFlags) (*strava3golang.APIClient, error)
func GetActivitiesAndStreams ¶
func GetActivitiesAndStreams(config *ActivitiesConfig, filter ActivityFilter) ( []util.Jsonable, error)
note that this may return a partial result even when error is not nil
func InitLogging ¶
func InitLogging(logFile string)
func RetrieveActivities ¶
func RetrieveActivities(config *ActivitiesConfig) ( []strava3golang.SummaryActivity, error)
func RetrieveStreams ¶
func RetrieveStreams(config *ActivitiesConfig, activityIds []int64) ([]*strava3golang.StreamSet, error)
retrieve the corresponding StreamSet for each activity in activityIds note that when an error is returned the returned stream may be partially complete
Types ¶
type AbridgedSummaryActivity ¶
type AbridgedSummaryActivity struct { // The unique identifier of the activity Id *int64 `json:"id,omitempty"` // The identifier provided at upload time ExternalId *string `json:"external_id,omitempty"` // The name of the activity Name *string `json:"name,omitempty"` // The activity's distance, in meters Distance *float32 `json:"distance,omitempty"` // The activity's moving time, in seconds MovingTime *int32 `json:"moving_time,omitempty"` // The activity's elapsed time, in seconds ElapsedTime *int32 `json:"elapsed_time,omitempty"` // The activity's average speed, in meters per second AverageSpeed *float32 `json:"average_speed,omitempty"` // Average power output in watts during this activity. Rides only AverageWatts *float32 `json:"average_watts,omitempty"` Type *strava3golang.ActivityType `json:"type,omitempty"` }
intended to be used for logging activities.
func GetAbridgedActivity ¶
func GetAbridgedActivity(o *strava3golang.SummaryActivity) AbridgedSummaryActivity
func MapActivitiesToAbridged ¶
func MapActivitiesToAbridged( activities []Activity) []AbridgedSummaryActivity
type ActivitiesConfig ¶
type ActivityAndStream ¶
type ActivityAndStream struct { Activity *strava3golang.SummaryActivity StreamSet *strava3golang.StreamSet }
func (*ActivityAndStream) ToJson ¶
func (aas *ActivityAndStream) ToJson() string
type ActivityFilter ¶
accepts a list of activity ids to consider. Returns the list of activity ids whose streams should be downloaded, or an error it is expected that the returned ids are in the same relative order as the inputs
type StravaFlags ¶
type StravaFlags struct { Config ActivitiesConfig OauthConfigFile string OauthTokenFile string // contains filtered or unexported fields }
func (*StravaFlags) InitFlags ¶
func (sf *StravaFlags) InitFlags(fs *flag.FlagSet) error
must be called before flag.Parse().
func (*StravaFlags) PostProcessFlags ¶
func (sf *StravaFlags) PostProcessFlags(fs *flag.FlagSet) error
must be called after flag.Parse(). Panics on any error
type StreamKind ¶
type StreamKind string
const ( StreamTime StreamKind = "time" StreamDistance StreamKind = "distance" StreamLatlng StreamKind = "latlng" StreamAltitude StreamKind = "altitude" StreamVelicitySmooth StreamKind = "velocity_smooth" StreamHeartrate StreamKind = "heartrate" StreamCadence StreamKind = "cadence" StreamWatts StreamKind = "watts" StreamTemp StreamKind = "temp" StreamMoving StreamKind = "moving" StreamGradeSmooth StreamKind = "grade_smooth" )
Click to show internal directories.
Click to hide internal directories.