Categorygithub.com/obalunenko/strava-api
module
1.0.0
Repository: https://github.com/obalunenko/strava-api.git
Documentation: pkg.go.dev

# README

strava-api

Go Strava API client generated from API spec

Examples:

Usage examples

Usage

package main

import (
	"context"
	"fmt"
	"log"
	"os"
	"time"

	strava "github.com/obalunenko/strava-api/client"
)

func main() {
	key := "STRAVA_ACCESS_TOKEN"
	
	token := os.Getenv(key)
	if token == "" {
		log.Fatalf("%q not set", key)
	}

	apiClient, err := strava.NewAPIClient(token)
	if err != nil {
		log.Fatal(err)
	}

	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()

	athlete, err := apiClient.Athletes.GetLoggedInAthlete(ctx)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(athlete)
}

# Packages

Package client provides a wrapper around the generated Strava API client.
No description provided by the author