parse

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(files []*scan.File, selector *Selector) ([]*Activity, *Stats, error)

Types

type Activity

type Activity struct {
	Sport    string
	Distance float64
	Records  []*Record
}

type Record

type Record struct {
	Timestamp time.Time
	Position  geo.Point
	X, Y      int
	Percent   float64
}

type Selector

type Selector struct {
	Sports                                         []string
	After, Before                                  time.Time
	MinDuration, MaxDuration                       time.Duration
	MinDistance, MaxDistance                       float64
	MinPace, MaxPace                               time.Duration
	BoundedBy, StartsNear, EndsNear, PassesThrough geo.Circle
}

func (*Selector) Bounded

func (s *Selector) Bounded(pt geo.Point) bool

func (*Selector) Distance

func (s *Selector) Distance(distance float64) bool

func (*Selector) Duration

func (s *Selector) Duration(duration time.Duration) bool

func (*Selector) Ends

func (s *Selector) Ends(pt geo.Point) bool

func (*Selector) Pace

func (s *Selector) Pace(duration time.Duration, distance float64) bool

func (*Selector) Passes

func (s *Selector) Passes(pt geo.Point) bool

func (*Selector) Sport

func (s *Selector) Sport(sport string) bool

func (*Selector) Starts

func (s *Selector) Starts(pt geo.Point) bool

func (*Selector) Timestamp

func (s *Selector) Timestamp(from, to time.Time) bool

type Stats

type Stats struct {
	CountActivities, CountRecords         int
	SportCounts                           map[string]int
	After, Before                         time.Time
	MinDuration, MaxDuration, SumDuration time.Duration
	MinDistance, MaxDistance, SumDistance float64
	MinPace, MaxPace                      time.Duration
	BoundedBy, StartsNear, EndsNear       geo.Circle
	Extent                                geo.Box
}

func (*Stats) Print

func (s *Stats) Print(p *message.Printer)

Jump to

Keyboard shortcuts

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