cmd

package
v0.0.0-...-1c6a0ac Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	RootCmd = &cobra.Command{
		Use:  "typioca",
		Long: "typioca — cozy typing speed tester",
		RunE: func(cmd *cobra.Command, args []string) error {
			if showVersion {
				fmt.Println("typioca ", Version)
				return nil
			} else {
				termenv.SetWindowTitle("typioca")
				defer println("bye!")

				termWidth, termHeight, _ := term.GetSize(int(os.Stdin.Fd()))
				p := tea.NewProgram(
					initialModel(
						termenv.ColorProfile(),
						termenv.ForegroundColor(),
						termWidth,
						termHeight,
					),
					tea.WithAltScreen(),
				)

				return p.Start()
			}
		},
	}
)

Functions

func OsInit

func OsInit()

func WriteConfig

func WriteConfig(config Config)

Types

type AllPersistedResults

type AllPersistedResults = map[TestType]map[NumericSetting]map[WordListName][]PersistentResultsNode

type Config

type Config struct {
	TestSettingCursors TestSettingCursors
	EmbededWordLists   []EmbededWordList
	WordLists          []WordList
	Version            int
}

func ReadConfig

func ReadConfig() Config

type ConfigView

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

type ConfigViewSelection

type ConfigViewSelection struct{}

func (ConfigViewSelection) Enabled

func (s ConfigViewSelection) Enabled() bool

type EmbededWordList

type EmbededWordList struct {
	Name        string
	IsSentences bool
	Enabled     bool
}

type LocalConfig

type LocalConfig struct {
	Words []WordList
}
type MainMenu struct {
	// contains filtered or unexported fields
}
type MainMenuSelection interface {
	Enabled() bool
	// contains filtered or unexported methods
}

type NumericSetting

type NumericSetting = int

type PersistentResults

type PersistentResults struct {
	Results AllPersistedResults
	Version int
}

func PersistResults

func PersistResults(results Results) PersistentResults

type PersistentResultsNode

type PersistentResultsNode struct {
	Wpm           int
	Accuracy      float64
	DeltaWpm      float64
	RawWpm        int
	Cpm           int
	WpmEachSecond []float64
}

type Results

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

type ResultsIdentifier

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

type SentenceCountBasedTest

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

type SentenceCountBasedTestSettings

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

func (SentenceCountBasedTestSettings) Enabled

type SentenceCountTestResults

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

type State

type State interface{}

type StringStyle

type StringStyle func(string) termenv.Style

type Styles

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

type TestBase

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

type TestSettingCursors

type TestSettingCursors struct {
	TimerTimeCursor     int
	TimerWordlistCursor int

	WordCountCursor         int
	WordCountWordlistCursor int

	SentenceCountCursor         int
	SentenceCountWordlistCursor int
}

type TestType

type TestType = string

type TimerBasedTest

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

type TimerBasedTestResults

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

type TimerBasedTestSettings

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

func (TimerBasedTestSettings) Enabled

func (s TimerBasedTestSettings) Enabled() bool

type Toggleable

type Toggleable interface {
	// contains filtered or unexported methods
}

type WordCountBasedTest

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

type WordCountBasedTestSettings

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

func (WordCountBasedTestSettings) Enabled

func (s WordCountBasedTestSettings) Enabled() bool

type WordCountTestResults

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

type WordList

type WordList struct {
	Sentences bool
	Name      string
	Path      string
	RemoteURI string

	Enabled bool
	// contains filtered or unexported fields
}

type WordListName

type WordListName = string

type WordListSelection

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

type WordsSelection

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

todo: clean these up. Maybe we could reuse filtering by enabled and synce, because now it's redundant

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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