package
0.0.0-20240320160759-ece4b7e92d44
Repository: https://github.com/saphmb/jaunt.git
Documentation: pkg.go.dev

# README

Go API client for swagger

The Swagger Playground is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with different endpoints depending on the authorization scope you receive from your athletes. To use the Playground, go to https://www.strava.com/settings/api and change your “Authorization Callback Domain” to developers.strava.com. Please note, we only support Swagger 2.0. There is a known issue where you can only select one scope at a time. For more information, please check the section “client code” at https://developers.strava.com/docs.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 3.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to https://www.strava.com/api/v3

ClassMethodHTTP requestDescription
ActivitiesApiCreateActivityPost /activitiesCreate an Activity
ActivitiesApiGetActivityByIdGet /activities/{id}Get Activity
ActivitiesApiGetCommentsByActivityIdGet /activities/{id}/commentsList Activity Comments
ActivitiesApiGetKudoersByActivityIdGet /activities/{id}/kudosList Activity Kudoers
ActivitiesApiGetLapsByActivityIdGet /activities/{id}/lapsList Activity Laps
ActivitiesApiGetLoggedInAthleteActivitiesGet /athlete/activitiesList Athlete Activities
ActivitiesApiGetZonesByActivityIdGet /activities/{id}/zonesGet Activity Zones
ActivitiesApiUpdateActivityByIdPut /activities/{id}Update Activity
AthletesApiGetLoggedInAthleteGet /athleteGet Authenticated Athlete
AthletesApiGetLoggedInAthleteZonesGet /athlete/zonesGet Zones
AthletesApiGetStatsGet /athletes/{id}/statsGet Athlete Stats
AthletesApiUpdateLoggedInAthletePut /athleteUpdate Athlete
ClubsApiGetClubActivitiesByIdGet /clubs/{id}/activitiesList Club Activities
ClubsApiGetClubAdminsByIdGet /clubs/{id}/adminsList Club Administrators
ClubsApiGetClubByIdGet /clubs/{id}Get Club
ClubsApiGetClubMembersByIdGet /clubs/{id}/membersList Club Members
ClubsApiGetLoggedInAthleteClubsGet /athlete/clubsList Athlete Clubs
GearsApiGetGearByIdGet /gear/{id}Get Equipment
RoutesApiGetRouteAsGPXGet /routes/{id}/export_gpxExport Route GPX
RoutesApiGetRouteAsTCXGet /routes/{id}/export_tcxExport Route TCX
RoutesApiGetRouteByIdGet /routes/{id}Get Route
RoutesApiGetRoutesByAthleteIdGet /athletes/{id}/routesList Athlete Routes
SegmentEffortsApiGetEffortsBySegmentIdGet /segment_effortsList Segment Efforts
SegmentEffortsApiGetSegmentEffortByIdGet /segment_efforts/{id}Get Segment Effort
SegmentsApiExploreSegmentsGet /segments/exploreExplore segments
SegmentsApiGetLoggedInAthleteStarredSegmentsGet /segments/starredList Starred Segments
SegmentsApiGetSegmentByIdGet /segments/{id}Get Segment
SegmentsApiStarSegmentPut /segments/{id}/starredStar Segment
StreamsApiGetActivityStreamsGet /activities/{id}/streamsGet Activity Streams
StreamsApiGetRouteStreamsGet /routes/{id}/streamsGet Route Streams
StreamsApiGetSegmentEffortStreamsGet /segment_efforts/{id}/streamsGet Segment Effort Streams
StreamsApiGetSegmentStreamsGet /segments/{id}/streamsGet Segment Streams
UploadsApiCreateUploadPost /uploadsUpload Activity
UploadsApiGetUploadByIdGet /uploads/{uploadId}Get Upload

Documentation For Models

Documentation For Authorization

strava_oauth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://www.strava.com/api/v3/oauth/authorize
  • Scopes:
  • read: Read public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards
  • read_all: Read private routes, private segments, and private events for the user
  • profile:read_all: Read all profile information even if the user has set their profile visibility to Followers or Only You
  • profile:write: Update the user's weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf
  • activity:read: Read the user's activity data for activities that are visible to Everyone and Followers, excluding privacy zone data
  • activity:read_all: The same access as activity:read, plus privacy zone data and access to read the user's activities with visibility set to Only You
  • activity:write: Access to create manual activities and uploads, and access to edit any activities that are visible to the app, based on activity read access level

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.
List of SportType.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A set of rolled-up statistics and totals for an athlete.
A roll-up of metrics pertaining to a set of activities.
No description provided by the author
No description provided by the author
APIClient manages communication with the Strava API v3 API v3.0.0 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Encapsulates the errors that may be returned from the API.
GenericSwaggerError Provides access to the body, error and model on returned errors.
No description provided by the author
No description provided by the author
No description provided by the author
A pair of latitude/longitude coordinates, represented as an array of 2 floating point numbers.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Stores the exclusive ranges representing zones and the time spent in each.
A union type representing the time spent in a given zone.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SportType : An enumeration of the sport types an activity may have.
No description provided by the author
No description provided by the author