// FetchAllActivities will fetch and return all activities (within the after/before defined in StravaAPI.opts)
FetchAllActivities will fetch and return all activities (within the after/before defined in StravaAPI.opts)
// FetchAllActivities will fetch and return all activities ( within the after / before defined in StravaAPI . opts )
func FetchAllActivities(stravaAccessToken string) ([]swagger.SummaryActivity, error) {
	stravaAPI := NewStravaAPI(stravaAccessToken)
	stravaAPI.opts.PerPage = optional.NewInt32(200) 
	var allActivities []swagger.SummaryActivity
	for i := 1; ; i++ {
		activities, err := stravaAPI.fetchActivitiesSinglePage(i)
		if err != nil {
			return []swagger.SummaryActivity{}, err
		}
		allActivities = append(allActivities, activities...)
		if int32(len(activities)) != stravaAPI.opts.PerPage.Value() {
			break
		}
	}
	return allActivities, nil
}
func FetchAllActivities ( stravaAccessToken string ) ( [ ] swagger . SummaryActivity , error ) { stravaAPI := NewStravaAPI ( stravaAccessToken ) stravaAPI . opts . PerPage = optional . NewInt32 ( 200 ) var allActivities [ ] swagger . SummaryActivity for i := 1 ; ; i ++ { activities , err := stravaAPI . fetchActivitiesSinglePage ( i ) if err != nil { return [ ] swagger . SummaryActivity { } , err } allActivities = append ( allActivities , activities ... ) if int32 ( len ( activities ) ) != stravaAPI . opts . PerPage . Value ( ) { break } } return allActivities , nil }
FetchAllActivities will fetch and return all activities (within the after/before defined in StravaAPI.opts)
FetchAllActivities will fetch and return all activities ( within the after / before defined in StravaAPI . opts )
// set to max limit if we are going to fetch all anyway (https://developers.strava.com/docs/#Pagination) // repeat the cicle until returns less than PerPage