zp

package
v0.0.0-...-ad15bf8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() (*http.Client, error)

Types

type Event

type Event struct {
	EventType     string        `json:"f_t"`
	EventDateSecs EventDateType `json:"event_date"`
	EventDate     time.Time
	EventTitle    string      `json:"event_title"`
	AvgWkg        interface{} `json:"avg_wkg"`
	WkgFtp        interface{} `json:"wkg_ftp"`
}

Event is a ZwiftPower event

type EventDateType

type EventDateType int64

EventDateType so we can use a custom unmarshaller

func (*EventDateType) UnmarshalJSON

func (e *EventDateType) UnmarshalJSON(data []byte) error

UnmarshalJSON custom because usually EventDateSecs is a number, but sometimes it's an empty string

type Rider

type Rider struct {
	Name             string
	Zwid             int
	LatestEventDate  time.Time
	Rides            int
	Races            int
	Races90          int
	Races30          int
	Ftp90            float64
	Ftp60            float64
	Ftp30            float64
	LatestRace       string
	LatestRaceDate   time.Time
	LatestEvent      string
	LatestRaceAvgWkg float64
	LatestRaceWkgFtp float64
}

Rider shows data about a rider

func ImportRider

func ImportRider(client *http.Client, riderID int) (rider Rider, err error)

ImportRider imports data about the rider with this ID

func ImportZP

func ImportZP(client *http.Client, clubID int) ([]Rider, error)

ImportZP imports data about the club with this ID

func (Rider) MonthsAgo

func (r Rider) MonthsAgo() string

MonthsAgo describes how many months since the rider's latest event

func (Rider) Strings

func (r Rider) Strings() []string

Strings turns a rider struct into []string

Jump to

Keyboard shortcuts

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