strava

package
v0.0.0-...-1bee8d1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoTokenError = errors.New("current user doesn't have strava access tokens")

Functions

This section is empty.

Types

type Activity

type Activity struct {
	ID                  int       `json:"id"`
	Name                string    `json:"name"`
	Distance            float64   `json:"distance"`
	MovingTime          int       `json:"moving_time"`
	ElapsedTime         int       `json:"elapsed_time"`
	TotalEleveationGain float64   `json:"total_elevation_gain"`
	Type                string    `json:"Walk"`
	StartDate           time.Time `json:"start_date"`
	AverageSpeed        float64   `json:"average_speed"`
}

type Point

type Point struct {
	TimeOffset int
	Latitude   float64
	Longitude  float64
	Altitude   float64
	Distance   float64
}

type Service

type Service struct {
	DB *gorm.DB
}

func New

func New() *Service

func (Service) Activity

func (s Service) Activity(ctx context.Context, id int) (Activity, error)

func (Service) ActivityPoints

func (s Service) ActivityPoints(ctx context.Context, id int) ([]Point, error)

func (*Service) Configure

func (s *Service) Configure(app gongo.App) error

func (Service) RecentActivities

func (s Service) RecentActivities(ctx context.Context) ([]Activity, error)

func (Service) Resources

func (s Service) Resources() []interface{}

type StravaUserTokens

type StravaUserTokens struct {
	gorm.Model

	User   *authorization.User
	UserID uint

	AccessToken  string
	RefreshToken string
}

type Stream

type Stream struct {
	Type         string `json:"type"`
	SeriesType   string `json:"series_type"`
	Resolution   string `json:"resolution"`
	OriginalSize int    `json:"original_size"`
	Data         json.RawMessage
}

type Tokens

type Tokens struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

Jump to

Keyboard shortcuts

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