Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModeStrategy ¶
type ModeStrategy interface {
GetConfig() core.ModeConfig
GetTarget() string
GetInitialTime() int
ProcessTick(TickContext) tea.Cmd
}
func StringToMode ¶ added in v0.1.3
func StringToMode(mode string, ctx core.ModeConfig) ModeStrategy
type QuoteMode ¶
type QuoteMode struct {
Target string
Language database.Language
Category database.QuoteCategory
}
func NewQuoteMode ¶ added in v0.1.3
func NewQuoteMode(options ...QuoteOption) *QuoteMode
func (QuoteMode) GetConfig ¶ added in v0.1.3
func (qm QuoteMode) GetConfig() core.ModeConfig
func (QuoteMode) GetInitialTime ¶
func (QuoteMode) ProcessTick ¶ added in v0.1.3
func (qm QuoteMode) ProcessTick(ctx TickContext) tea.Cmd
type QuoteOption ¶ added in v0.1.3
type QuoteOption func(qm *QuoteMode)
func WithCategoryQ ¶ added in v0.1.3
func WithCategoryQ(category database.QuoteCategory) QuoteOption
func WithLanguageQ ¶ added in v0.1.3
func WithLanguageQ(language database.Language) QuoteOption
func WithTargetQ ¶ added in v0.1.3
func WithTargetQ(target string) QuoteOption
type StaticMode ¶
type StaticMode struct {
Target string
}
func NewStaticMode ¶ added in v0.1.3
func NewStaticMode() *StaticMode
func (StaticMode) GetConfig ¶ added in v0.1.3
func (s StaticMode) GetConfig() core.ModeConfig
func (StaticMode) GetInitialTime ¶
func (qm StaticMode) GetInitialTime() int
func (StaticMode) GetTarget ¶
func (qm StaticMode) GetTarget() string
func (StaticMode) ProcessTick ¶ added in v0.1.3
func (qm StaticMode) ProcessTick(ctx TickContext) tea.Cmd
type TickContext ¶ added in v0.1.3
type TimeMode ¶
func NewTimeMode ¶ added in v0.1.3
func NewTimeMode(options ...TimeOption) *TimeMode
func (TimeMode) GetConfig ¶ added in v0.1.3
func (t TimeMode) GetConfig() core.ModeConfig
func (TimeMode) GetInitialTime ¶
func (TimeMode) ProcessTick ¶ added in v0.1.3
func (t TimeMode) ProcessTick(ctx TickContext) tea.Cmd
type TimeOption ¶ added in v0.1.3
type TimeOption func(*TimeMode)
func WithInitialTimeT ¶ added in v0.1.3
func WithInitialTimeT(initTime int) TimeOption
func WithLanguageT ¶ added in v0.1.3
func WithLanguageT(language database.Language) TimeOption
func WithTargetT ¶ added in v0.1.3
func WithTargetT(target string) TimeOption
type WordMode ¶
func NewWordMode ¶ added in v0.1.3
func NewWordMode(options ...WordOption) *WordMode
func (WordMode) GetConfig ¶ added in v0.1.3
func (w WordMode) GetConfig() core.ModeConfig
func (WordMode) GetInitialTime ¶
func (WordMode) ProcessTick ¶ added in v0.1.3
func (w WordMode) ProcessTick(ctx TickContext) tea.Cmd
type WordOption ¶ added in v0.1.3
type WordOption func(wm *WordMode)
func WithInitialWords ¶ added in v0.1.3
func WithInitialWords(n int) WordOption
func WithLanguageW ¶ added in v0.1.3
func WithLanguageW(language database.Language) WordOption
func WithTargetW ¶ added in v0.1.3
func WithTargetW(target string) WordOption
Click to show internal directories.
Click to hide internal directories.