fto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TMIncreaseFactor is the percent increase for a
	// training max that is used to calculate a new training max
	// after 3 weeks. In the book the rule of thumb is 5 lbs for upper body
	// and 10 lbs for lower body, but this make the jumps way too high for
	// light lifters, and this facter seems to be a sweet spot for lifting in general.
	TMIncreaseFactor float64 = 0.02

	// MaxTrainingMax is the absolute maximum value that is allowed for any lift.
	MaxTrainingMax float64 = 2000
)
View Source
const (
	// Deload1 (5x40%, 5x50%, 5x60%)
	Deload1 = iota
	// Deload2 (5x50%, 5x60%, 5x70%)
	Deload2
	// Deload3 (3x65%, 5x75%, 5x85%)
	Deload3
	// Deload4 (10x40%, 8x50%, 6x60%)
	Deload4
	// Deload5 (10x50%, 8x60%, 6x70%)
	Deload5
)

Variables

View Source
var (
	// ErrInvalidDeloadType represents an invalid DeloadType
	ErrInvalidDeloadType = errors.New("invalid DeloadType")
	// ErrInvalidSetType represents an invalid SetType
	ErrInvalidSetType = errors.New("invalid SetType")
	// ErrInvalidStrategyType represents an invalid StrategyType
	ErrInvalidStrategyType = errors.New("invalid StrategyType")
)

Functions

func FormFields

func FormFields() (liftplan.FormFields, error)

FormFields returns a liftplan.FormFields

Types

type DeloadType

type DeloadType uint

DeloadType is an ENUM type for the various versions of deload templates

func (DeloadType) MarshalJSON

func (d DeloadType) MarshalJSON() ([]byte, error)

MarshalJSON is the json marshaller for DeloadType

func (DeloadType) String

func (d DeloadType) String() string

String is the string representation of a deload type

func (*DeloadType) UnmarshalJSON

func (d *DeloadType) UnmarshalJSON(b []byte) error

UnmarshalJSON is the json unmarshaller for DeloadType

type Movement

type Movement struct {
	Name        string    `json:"name"`
	TrainingMax float64   `json:"training_max"`
	Unit        gear.Unit `json:"unit"`
	Calculated  bool      `json:"calculated"`
}

Movement is used to capture the needed info for a 5/3/1 movement, such as Deadlift, Overhead Press, etc. It gets a Name, TrainingMax (90% of absolute 1RM) and a unit.

type Progression

type Progression []Week

Progression is a slice of Weeks.

type Session

type Session []Set

Session represents a slice of Set. This is all sets that should be performed in a workout.

func (Session) CountSetType

func (s Session) CountSetType(t SetType) int

CountSetType takes a SetType an returns count as and int of that type. This is used to see how many sets of a specific type exists in a Session

func (Session) SetTypeIndex

func (s Session) SetTypeIndex(t SetType) int

SetTypeIndex takes a SetType and returns the first match as an int for its position in the Session slice its returns a -1 if it finds nothing.

type Set

type Set struct {
	Movement Movement  `json:"movement"`
	Percent  float64   `json:"percentage"`
	Reps     uint      `json:"reps"`
	AMRAP    bool      `json:"amrap"`
	Type     SetType   `json:"type"`
	Weight   float64   `json:"weight,omitempty"`
	Plates   []float64 `json:"plates,omitempty"`
}

Set outlines how a Movement is performed, it includes a percent to calculate from Movement.TrainingMax, rep count, it also gets an AMRAP (As Many Reps As Possible) bool, which indicates if a set is a "plus" round. For instance a set with 5 reps simply should perform 5 reps, while a set of 5 reps + AMRAP = true, should perform a minimum of 5 reps, but should attempt for As Many Reps As Possible(AMRAP). The Type is the SetType for the movement.

type SetType

type SetType uint8

SetType is used as an ENUM type for Movements

const (
	// Working is the primary SetTyp for a 531 workout.
	Working SetType = iota
	// Warmup is an optional SetType to be performed before a working set.
	Warmup
	// Auxiliary is First Set Last, a special type.
	Auxiliary
	// Joker is Joker Sets, which are typically performed after a working set.
	Joker
)

func (SetType) MarshalJSON

func (s SetType) MarshalJSON() ([]byte, error)

MarshalJSON is the json marshaller for SetType

func (SetType) String

func (s SetType) String() string

String implementation of SetType

func (*SetType) UnmarshalJSON

func (s *SetType) UnmarshalJSON(b []byte) error

UnmarshalJSON is the json unmarshaller for SetType

type Strategy

type Strategy struct {
	Movements       []Movement   `json:"movements"`
	Gear            gear.Gear    `json:"gear"`
	Type            StrategyType `json:"type"`
	Deload          DeloadType   `json:"deload_type"`
	Warmup          bool         `json:"warmup"`
	JokerSets       bool         `json:"joker_sets"`
	RecommendPlates bool         `json:"recommend_plates"`
}

Strategy is a 531 struct that containers movements, gear, and strategy

func FromValues

func FromValues(v url.Values) (s Strategy, err error)

FromValues takes a `url.Values` and builds and returns a strategy an error.

func (Strategy) Plan

func (s Strategy) Plan(f liftplan.Format) ([]byte, error)

Plan implements a liftplan.Plan

func (Strategy) Values

func (s Strategy) Values() (url.Values, error)

Values conforms to the Valuer interface and is part of the LiftPlanner interface

type StrategyType

type StrategyType uint

StrategyType is a type used to enumerate various strategies for 531.

const (
	// FSLMULTI is a StrategyType for First Set Last (5x8) + Joker Sets
	FSLMULTI StrategyType = iota
	// FSL is a StrategyType for FSL AMRAP in a single set
	FSL
)

func StrategyTypeFromString

func StrategyTypeFromString(s string) (StrategyType, error)

StrategyTypeFromString takes a string and returns a StrategyType and an error

func (StrategyType) MarshalJSON

func (s StrategyType) MarshalJSON() ([]byte, error)

MarshalJSON is the json marshaller for StrategyType

func (StrategyType) String

func (s StrategyType) String() string

func (*StrategyType) UnmarshalJSON

func (s *StrategyType) UnmarshalJSON(b []byte) error

UnmarshalJSON is the json unmarshaller for StrategyType

type Week

type Week struct {
	Sessions        []Session `json:"sessions"`
	Deload          bool      `json:"deload,omitempty"`
	RecommendPlates bool      `json:"recommend_plates,omitempty"`
}

A Week is a slice of sessions as well as a Deload boolean

func (Week) DisplayNumber

func (w Week) DisplayNumber(n int) int

DisplayNumber shows the week number in human readable form from index

Jump to

Keyboard shortcuts

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