goworkouts

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 8 Imported by: 0

README

goworkouts

Read & write FIT workout files, translate them to JSON

Documentation

Index

Constants

View Source
const MaxUint = ^uint32(0)

MaxUint maximum int value (default in fit)

Variables

This section is empty.

Functions

func WriteFit

func WriteFit(f string, w *fit.File, overwrite bool) (ok bool, err error)

WriteFit writes FIT file from Workout

Types

type TrainingDay

type TrainingDay struct {
	Order    uint32    `json:"order"` // how manieth calendar day
	Workouts []Workout `json:"workouts"`
}

TrainingDay is a training day in the training plan

type TrainingPlan

type TrainingPlan struct {
	TrainingDays []TrainingDay `json:"trainingDays"`
	Duration     uint32        `json:"duration"` // in number of calendar days
}

TrainingPlan is a training plan

type Workout

type Workout struct {
	Filename    string        `json:"filename"`
	Name        string        `json:"workoutName"`
	Steps       []workoutStep `json:"steps"`
	Sport       string        `json:"sport"`
	Description string        `json:"description"`
}

Workout is a Workout

func FromJSON

func FromJSON(s string) (Workout, error)

FromJSON returns workout from json string

func ReadFit

func ReadFit(f string) (Workout, error)

ReadFit Read FIT file

func (*Workout) ToFIT

func (w *Workout) ToFIT() (*fit.File, error)

ToFIT exports to FIT only creates empty FIT object for now

func (*Workout) ToJSON

func (w *Workout) ToJSON() ([]byte, error)

ToJSON export to JSON

Jump to

Keyboard shortcuts

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