workout

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExerciseData

type ExerciseData struct {
	Template api.ExerciseTemplate
	Sets     []SetData
	Notes    string
	Done     bool
}

ExerciseData represents an exercise in the workout

type SessionModel

type SessionModel struct {
	// contains filtered or unexported fields
}

SessionModel is the interactive workout session model

func NewSessionFromRoutine

func NewSessionFromRoutine(routine *api.Routine) SessionModel

NewSessionFromRoutine creates a session from a routine

func NewSessionModel

func NewSessionModel(title string, exercises []ExerciseData) SessionModel

NewSessionModel creates a new workout session

func (SessionModel) GetExercises

func (m SessionModel) GetExercises() []ExerciseData

GetExercises returns the exercise data

func (SessionModel) GetStartTime added in v0.2.0

func (m SessionModel) GetStartTime() time.Time

GetStartTime returns the workout start time

func (SessionModel) GetTitle added in v0.2.0

func (m SessionModel) GetTitle() string

GetTitle returns the workout title

func (SessionModel) Init

func (m SessionModel) Init() tea.Cmd

Init initializes the model

func (SessionModel) IsFinished

func (m SessionModel) IsFinished() bool

IsFinished returns true if workout was completed

func (SessionModel) Update

func (m SessionModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (SessionModel) View

func (m SessionModel) View() string

View renders the model

type SessionResult added in v0.2.0

type SessionResult struct {
	Title     string
	StartTime time.Time
	EndTime   time.Time
	Exercises []ExerciseData
	Finished  bool
}

SessionResult contains the results of a completed workout session

func RunSession

func RunSession(title string, exercises []ExerciseData) (*SessionResult, error)

Run starts the interactive workout session

func RunSessionFromRoutine

func RunSessionFromRoutine(routine *api.Routine) (*SessionResult, error)

RunSessionFromRoutine starts a session from a routine

type SetData

type SetData struct {
	Weight   float64
	Reps     int
	SetType  api.SetType
	Complete bool
}

SetData represents a single set being logged

Jump to

Keyboard shortcuts

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