parkrun

package
v0.0.0-...-cb2d5cb Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEX_UNKNOWN = iota
	SEX_FEMALE
	SEX_MALE
)
View Source
const (
	StateStart = iota
	StateDate
	StateIndex
	StateRunners
	StateEnd
)

Variables

View Source
var (
	InvalidCoordinates = Coordinates{100, 0}
)

Functions

func ParseAgeGroup

func ParseAgeGroup(s string) (string, int, error)

func RenderJs

func RenderJs(events []*Event, filePath string) error

Types

type Coordinates

type Coordinates struct {
	Lat, Lon float64
}

func (Coordinates) IsValid

func (c Coordinates) IsValid() bool

type Data

type Data struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value"`
}

type Event

type Event struct {
	EventId                     int
	Id                          string
	Name                        string
	Location                    string
	Coords                      Coordinates
	CountryUrl                  string
	GoogleMapsId                string
	Tracks                      [][]Coordinates
	LatestRun                   *Run
	Current                     bool
	Order                       int
	Status                      string
	SummaryRegistrations        int
	SummaryRunners              int
	SummaryIndividualRunners    int
	SummaryVolunteers           int
	SummaryIndividualVolunteers int
}

func LoadEvents

func LoadEvents(events_json_file string, parkruns_json_file string, germanyOnly bool) ([]*Event, error)

func (Event) Active

func (event Event) Active() bool

func (Event) Archived

func (event Event) Archived() bool

func (Event) Cafe

func (event Event) Cafe() Link

func (Event) CoursePageUrl

func (event Event) CoursePageUrl() string

func (Event) First

func (event Event) First() string

func (Event) FixedLocation

func (event Event) FixedLocation() string

func (Event) FixedName

func (event Event) FixedName() string

func (Event) GoogleMapsCourseUrl

func (event Event) GoogleMapsCourseUrl() string

func (Event) GoogleMapsUrl

func (event Event) GoogleMapsUrl() string

func (Event) LastRun

func (event Event) LastRun() string

func (*Event) LoadCoursePage

func (event *Event) LoadCoursePage(filePath string) error

func (*Event) LoadKML

func (event *Event) LoadKML(filePath string) error

func (*Event) LoadReport

func (event *Event) LoadReport(filePath string) error

func (*Event) LoadWiki

func (event *Event) LoadWiki(filePath string) error

func (Event) Outdated

func (event Event) Outdated() bool

func (Event) Planned

func (event Event) Planned() bool

func (Event) ReportUrl

func (event Event) ReportUrl() string

func (Event) ResultsUrl

func (event Event) ResultsUrl() string

func (Event) Social

func (event Event) Social() []Link

func (Event) Strava

func (event Event) Strava() []Link

func (Event) SummaryRunnersAvg

func (event Event) SummaryRunnersAvg() string

func (Event) SummaryVolunteersAvg

func (event Event) SummaryVolunteersAvg() string

func (Event) Url

func (event Event) Url() string

func (Event) WikiUrl

func (event Event) WikiUrl() string

type ExtendedData

type ExtendedData struct {
	Data []Data `xml:"Data"`
}

type KML

type KML struct {
	Placemarks []Placemark `xml:"Document>Folder>Placemark"`
}

type LineString

type LineString struct {
	Coordinates string `xml:"coordinates"`
}
type Link struct {
	Name string
	Url  string
}

func (Link) IsValid

func (link Link) IsValid() bool

type ParkrunInfo

type ParkrunInfo struct {
	Id          string
	Name        string
	City        string
	GoogleMaps  string
	First       string
	Status      string
	Coordinates string
	Cafe        struct {
		Name       string
		GoogleMaps string
	}
	Strava []Link
	Social []Link
}

func (ParkrunInfo) ParseCoordinates

func (info ParkrunInfo) ParseCoordinates() (Coordinates, error)

type Participant

type Participant struct {
	Id       string
	Name     string
	AgeGroup string
	Sex      int
	Runs     int64
	Vols     int64
	Time     time.Duration
}

type Placemark

type Placemark struct {
	Name       string     `xml:"name"`
	Point      Point      `xml:"Point"`
	LineString LineString `xml:"LineString"`
}

type Point

type Point struct {
	Coordinates string `xml:"coordinates"`
}

type Results

type Results struct {
	Index int
	Date  time.Time

	Runners []*Participant
}

type Run

type Run struct {
	Event       *Event
	Index       int
	Date        time.Time
	RunnerCount int
	Results     *Results
}

func (Run) DateF

func (run Run) DateF() string

func (Run) FastestT

func (run Run) FastestT() string

func (*Run) LoadResults

func (run *Run) LoadResults(filePath string) error

func (Run) Runners

func (run Run) Runners() string

func (Run) Url

func (run Run) Url() string

Jump to

Keyboard shortcuts

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