exercise

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

func Run

func Run(client *api.Client) (*api.ExerciseTemplate, error)

Run starts the interactive exercise search

Types

type ExerciseItem

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

ExerciseItem represents an exercise in the list

func (ExerciseItem) Description

func (i ExerciseItem) Description() string

func (ExerciseItem) FilterValue

func (i ExerciseItem) FilterValue() string

func (ExerciseItem) Title

func (i ExerciseItem) Title() string

type SearchModel

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

SearchModel is the interactive exercise search model

func NewSearchModel

func NewSearchModel(client *api.Client) SearchModel

NewSearchModel creates a new exercise search model

func (SearchModel) Init

func (m SearchModel) Init() tea.Cmd

Init initializes the model

func (SearchModel) Selected

func (m SearchModel) Selected() *api.ExerciseTemplate

Selected returns the selected exercise, if any

func (SearchModel) Update

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

Update handles messages

func (SearchModel) View

func (m SearchModel) View() string

View renders the model

type TableModel added in v0.3.0

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

TableModel is the interactive exercise table model

func NewTableModel added in v0.3.0

func NewTableModel(client *api.Client) TableModel

NewTableModel creates a new exercise table model

func (TableModel) GetResult added in v0.3.0

func (m TableModel) GetResult() TableResult

GetResult returns the table result

func (TableModel) Init added in v0.3.0

func (m TableModel) Init() tea.Cmd

Init initializes the model

func (TableModel) Update added in v0.3.0

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

Update handles messages

func (TableModel) View added in v0.3.0

func (m TableModel) View() string

View renders the model

type TableResult added in v0.3.0

type TableResult struct {
	Selected  *api.ExerciseTemplate
	Cancelled bool
}

TableResult represents the result of the table interaction

func RunTable added in v0.3.0

func RunTable(client *api.Client) (TableResult, error)

RunTable runs the interactive table and returns the result

Jump to

Keyboard shortcuts

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