stravutils

package module
v0.0.0-...-50d1e36 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const CLIMB_THRESHOLD = 0.03
View Source
const MAX_PER_PAGE = 200

Variables

This section is empty.

Functions

func GetEfforts

func GetEfforts(segmentID int64, maxPages int, tokens ...string) ([]strava.DetailedSegmentEffort, error)

func GetStravaContext

func GetStravaContext(codes ...string) (*context.Context, error)

func PowerWNF

func PowerWNF(power float64, s *Segment, current, past *weather.Conditions) (baseline, historical float64, err error)

func Resource

func Resource(name string) string

func WNF

func WNF(s *Segment, current, past *weather.Conditions) (baseline, historical float64, err error)

Types

type Climb

type Climb struct {
	Name    string   `json:"name"`
	Aliases []string `json:"aliases,omitempty"`
	Segment Segment  `json:"segment"`
}

func GetClimbs

func GetClimbs(files ...string) ([]Climb, error)

type HistoricalClimbAverages

type HistoricalClimbAverages map[int64]HistoricalMonthlyAverages

func GetHistoricalAverages

func GetHistoricalAverages(files ...string) (HistoricalClimbAverages, error)

func (*HistoricalClimbAverages) Get

type HistoricalHourlyAverages

type HistoricalHourlyAverages struct {
	Hourly []*weather.Conditions `json:"hourly"`
}

type HistoricalMonthlyAverages

type HistoricalMonthlyAverages struct {
	Monthly []*HistoricalHourlyAverages `json:"monthly"`
}

type Segment

type Segment struct {
	Name               string     `json:"name"`
	ID                 int64      `json:"id"`
	Distance           float64    `json:"distance"`
	AverageGrade       float64    `json:"average_grade"`
	ElevationLow       float64    `json:"elevation_low"`
	ElevationHigh      float64    `json:"elevation_high"`
	TotalElevationGain float64    `json:"total_elevation_gain"`
	MedianElevation    float64    `json:"median_elevation"`
	StartLocation      geo.LatLng `json:"start_location"`
	EndLocation        geo.LatLng `json:"end_location"`
	AverageLocation    geo.LatLng `json:"average_location,omitempty"`
	AverageDirection   float64    `json:average_direction,omitempty"`
	Map                string     `json:"map,omitempty"`
}

func GetSegmentByID

func GetSegmentByID(segmentID int64, climbs []Climb, tokens ...string) (*Segment, error)

type Weather

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

func NewWeatherClient

func NewWeatherClient(key, cache string, qps int, loc *time.Location, offline bool) *Weather

func (*Weather) Historical

func (w *Weather) Historical(ll geo.LatLng, t time.Time) (*weather.Forecast, error)

Directories

Path Synopsis
cmd
curve command
efforts command
ftp command
goals command
historical command
latlngs command
segments command
strava command
weather command
windsock command

Jump to

Keyboard shortcuts

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