strava

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Athlete

type Athlete struct {
	Athlete *client.AthleteSummary
	Stats   *client.AthleteStats
}

type GPX

type GPX struct {
	XMLName xml.Name `xml:"gpx"`
	Version string   `xml:"version,attr"`
	Creator string   `xml:"creator,attr"`
	XMLNS   string   `xml:"xmlns,attr"`
	Trk     Trk      `xml:"trk"`
}

type Strava

type Strava struct {
	// contains filtered or unexported fields
}

func NewStrava

func NewStrava(ctx context.Context, log *zap.Logger) *Strava

func (*Strava) ExportGPX

func (s *Strava) ExportGPX(user *User, activityId int64) (string, error)

func (*Strava) GetAccessToken

func (s *Strava) GetAccessToken(cfg *models.Config, code string) (*client.AuthorizationResponse, error)

func (*Strava) GetActivityDetail

func (s *Strava) GetActivityDetail(user *User, activityId int64) (*client.ActivityDetailed, error)

func (*Strava) GetActivityLaps

func (s *Strava) GetActivityLaps(user *User, activityId int64) ([]*client.LapEffortSummary, error)

func (*Strava) GetActivityStream

func (s *Strava) GetActivityStream(user *User, activityId int64) (*client.StreamSet, error)

func (*Strava) GetAllActivities

func (s *Strava) GetAllActivities(user *User) ([]*client.ActivitySummary, error)

func (*Strava) GetAthlete

func (s *Strava) GetAthlete(user *User, athleteId int64) (*Athlete, error)

func (*Strava) GetAuthorizationURL

func (s *Strava) GetAuthorizationURL(cfg *models.Config, callbackURL string) string

func (*Strava) GetBeforeOfActivities

func (s *Strava) GetBeforeOfActivities(user *User, before int64) ([]*client.ActivitySummary, error)

func (*Strava) GetCurrentAthlete

func (s *Strava) GetCurrentAthlete(accessToken string) (*client.AthleteDetailed, error)

func (*Strava) GetGear

func (s *Strava) GetGear(user *User, gearId string) (*client.GearDetailed, error)

func (*Strava) GetPageOfActivities

func (s *Strava) GetPageOfActivities(user *User, page int) ([]*client.ActivitySummary, error)

func (*Strava) NewUser

func (s *Strava) NewUser(cfg *models.Config, accessToken string) (*User, error)

func (*Strava) ParseError

func (s *Strava) ParseError(err error) *client.Error

type Trk

type Trk struct {
	Name   string  `xml:"name"`
	Trkseg []Trkpt `xml:"trkseg>trkpt"`
}

type Trkpt

type Trkpt struct {
	Lat   float64 `xml:"lat,attr"`
	Lon   float64 `xml:"lon,attr"`
	Ele   float64 `xml:"ele,omitempty"`
	Time  string  `xml:"time"`
	Temp  int     `xml:"temp,omitempty"`
	HR    int     `xml:"hr,omitempty"`
	Cad   int     `xml:"cad,omitempty"`
	Pwr   int     `xml:"pwr,omitempty"`
	Spd   float64 `xml:"spd,omitempty"`
	Dist  float64 `xml:"dist,omitempty"`
	Mov   bool    `xml:"mov,omitempty"`
	Grade float64 `xml:"grade,omitempty"`
}

type User

type User struct {
	AccessToken string `json:"access_token"`

	Athlete *client.AthleteDetailed `json:"athlete"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL