interval

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: MIT Imports: 3 Imported by: 0

README

IAAF Intervals Build Status Go Report Card

Golang (de)serialization of interval notations using the IAAF Standard Representation of Running Training.

Usage

package main
    
    import (
    	"fmt"
    	interval "github.com/Voles/go-iaaf-intervals"
    )
    
    func main() {
    	set, err := interval.Parse("'2 x 6 x 400 (72”) [2’]'")
    	if err != nil {
    		panic(err)
    	}
    
    	fmt.Printf("total distance: %v", set.TotalDistance())
    }

Spec

sets x repetitions x distance (intensity/pace) [recovery between reps, then recovery between sets]

Credits

This implementation is based on the Python implementation created by Bas Wind.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repetition

type Repetition struct {
	Repeats  int
	Distance int
	Pace     string
	Recovery string
}

Repetition model

func (Repetition) TotalDistance

func (repetition Repetition) TotalDistance() int

TotalDistance returns the total distance for a repetition

type Set

type Set struct {
	Repeats     int
	Repetitions []Repetition
	Recovery    string
}

Set model

func Parse

func Parse(notation string) (Set, error)

Parse the notation of an interval

func (Set) TotalDistance

func (set Set) TotalDistance() int

TotalDistance returns the total distance for a set

Jump to

Keyboard shortcuts

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