goride

package module
v0.0.0-...-19d3dd0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) Get

func (c *Client) Get(base string, args url.Values) (string, error)

type Config

type Config struct {
	Email    string
	Password string
	KeyName  string
	CfgPath  string
}

func NewConfig

func NewConfig(path string) (*Config, error)

type Gear

type Gear struct {
	ID   int
	Name string
}

type LatLng

type LatLng struct {
	Lat float32
	Lng float32
}

type Metrics

type Metrics struct {
	AscentTime    int
	DescentTime   int
	Calories      int
	Distance      float32
	Duration      time.Duration
	ElevationGain float32 `json:"ele_gain"`
	ElevationLoss float32 `json:"ele_loss"`
	Grade         struct {
		Avg float32
		Max float32
		Min float32
	}
	MovingTime int
	Speed      struct {
		Avg float32
		Max float32
		Min float32
	}
	Stationary bool
}

type RWGPS

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

func New

func New(cfgPath string) (*RWGPS, error)

func (*RWGPS) Auth

func (r *RWGPS) Auth() error

func (*RWGPS) Get

func (r *RWGPS) Get(method string, args url.Values) (string, error)

func (*RWGPS) GetCurrentUser

func (r *RWGPS) GetCurrentUser() (*User, error)

func (*RWGPS) GetRide

func (r *RWGPS) GetRide(id int) (*Ride, error)

func (*RWGPS) GetRides

func (r *RWGPS) GetRides(user, offset, limit int) ([]*RideSlim, int, error)

type Ride

type Ride struct {
	ID          int
	Started     time.Time `json:"departed_at"`
	Metrics     Metrics
	Distance    float32
	Description string
	Name        string
	BoundingBox []LatLng `json:"bounding_box"`
}

type RideSlim

type RideSlim struct {
	ID                       int       `json:"id"`
	GroupMembershipID        int       `json:"group_membership_id"`
	RouteID                  int       `json:"route_id"`
	CreatedAt                time.Time `json:"created_at"`
	GearID                   int       `json:"gear_id"`
	DepartedAt               time.Time `json:"departed_at"`
	Duration                 int       `json:"duration"`
	Distance                 float32   `json:"distance"`
	ElevationGain            float32   `json:"elevation_gain"`
	ElevationLoss            float32   `json:"elevation_loss"`
	Visibility               int       `json:"visibility"`
	Description              string    `json:"description"`
	IsGps                    bool      `json:"is_gps"`
	Name                     string    `json:"name"`
	MaxHr                    float32   `json:"max_hr"`
	MinHr                    float32   `json:"min_hr"`
	AvgHr                    float32   `json:"avg_hr"`
	MaxCad                   float32   `json:"max_cad"`
	MinCad                   float32   `json:"min_cad"`
	AvgCad                   float32   `json:"avg_cad"`
	AvgSpeed                 float32   `json:"avg_speed"`
	MaxSpeed                 float32   `json:"max_speed"`
	MovingTime               int       `json:"moving_time"`
	Processed                bool      `json:"processed"`
	AvgWatts                 float32   `json:"avg_watts"`
	MaxWatts                 float32   `json:"max_watts"`
	MinWatts                 float32   `json:"min_watts"`
	IsStationary             bool      `json:"is_stationary"`
	Calories                 int       `json:"calories"`
	UpdatedAt                time.Time `json:"updated_at"`
	TimeZone                 string    `json:"time_zone"`
	FirstLng                 float64   `json:"first_lng"`
	FirstLat                 float64   `json:"first_lat"`
	LastLng                  float64   `json:"last_lng"`
	LastLat                  float64   `json:"last_lat"`
	UserID                   int       `json:"user_id"`
	DeletedAt                time.Time `json:"deleted_at"`
	SwLng                    float32   `json:"sw_lng"`
	SwLat                    float32   `json:"sw_lat"`
	NeLng                    float32   `json:"ne_lng"`
	NeLat                    float32   `json:"ne_lat"`
	TrackID                  string    `json:"track_id"`
	PostalCode               string    `json:"postal_code"`
	Locality                 string    `json:"locality"`
	AdministrativeArea       string    `json:"administrative_area"`
	CountryCode              string    `json:"country_code"`
	SourceType               string    `json:"source_type"`
	LikesCount               int       `json:"likes_count"`
	HighlightedPhotoID       int       `json:"highlighted_photo_id"`
	HighlightedPhotoChecksum string    `json:"highlighted_photo_checksum"`
	UtcOffset                int       `json:"utc_offset"`
}

type User

type User struct {
	ID         int
	Name       string
	AuthToken  string `json:"auth_token"`
	Gear       []Gear
	TotalTrips int `json:"trips_included_in_totals_count"`
}

Jump to

Keyboard shortcuts

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