Documentation
¶
Index ¶
- type ExerciseData
- type SessionModel
- func (m SessionModel) GetExercises() []ExerciseData
- func (m SessionModel) GetStartTime() time.Time
- func (m SessionModel) GetTitle() string
- func (m SessionModel) Init() tea.Cmd
- func (m SessionModel) IsFinished() bool
- func (m SessionModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m SessionModel) View() string
- type SessionResult
- type SetData
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) IsFinished ¶
func (m SessionModel) IsFinished() bool
IsFinished returns true if workout was completed
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
Click to show internal directories.
Click to hide internal directories.