web

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package web scrapes the strava website for functionality not available via the API.

Inspired by https://github.com/pR0Ps/stravaweblib

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService service

AuthService is the API for auth endpoints

func (*AuthService) Login

func (s *AuthService) Login(ctx context.Context, username, password string) error

Login creates a user session for the username/password

type Client

type Client struct {
	Auth    *AuthService
	Export  *ExportService
	Fitness *FitnessService
	// contains filtered or unexported fields
}

Client client

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient creates a new client and applies all provided Options

func (*Client) Exporter

func (c *Client) Exporter() activity.Exporter

type ExportService

type ExportService service

ExportService is the API for export endpoints

func (*ExportService) Export

func (s *ExportService) Export(ctx context.Context, activityID int64) (*activity.Export, error)

Export requests the data file for the activity

func (*ExportService) ExportWithFormat

func (s *ExportService) ExportWithFormat(ctx context.Context, activityID int64, format activity.Format) (*activity.Export, error)

Export requests the data file for the activity for the specified format

type FitnessService

type FitnessService service

FitnessService is the API for fitness endpoints

func (*FitnessService) TrainingLoad

func (s *FitnessService) TrainingLoad(ctx context.Context, userID int) ([]*strava.TrainingLoad, error)

TrainingLoad returns the training load for an athlete

type Option

type Option func(*Client) error

Option provides a configuration mechanism for a Client

func WithCookieJar

func WithCookieJar() Option

WithCookieJar attaches a cookie jar to the client

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the underlying http client.

func WithHTTPTracing

func WithHTTPTracing(debug bool) Option

WithHTTPTracing enables tracing http calls.

func WithRateLimiter

func WithRateLimiter(r *rate.Limiter) Option

WithRateLimiter rate limits the client's api calls

func WithTransport

func WithTransport(t http.RoundTripper) Option

WithTransport sets the underlying http client transport.

Jump to

Keyboard shortcuts

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