models

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnimSparkle = iota
	AnimMatrix
	AnimWipeRight
	AnimWipeLeft
	AnimRainbow
	AnimWave
	AnimBinary
	AnimDissolve
	AnimFlip
	AnimPulse
	AnimTypewriter
	AnimParticle
	AnimRedact
	AnimChaos
	AnimConverge
	AnimBounce
	AnimSpin
	AnimZipper
	AnimEraser
	AnimGlitch
	AnimMoons
	AnimBraille
	AnimHex
	AnimReverse
	AnimCaseFlip
	AnimWide
	AnimTraffic
	AnimCenterStrike
	AnimLoading
	AnimSlider

	AnimCount = 30
)

Variables

This section is empty.

Functions

func GenerateEncryptionKey

func GenerateEncryptionKey() (string, error)

GenerateEncryptionKey creates a new 32-byte key for AES-256

func InitStorage

func InitStorage(storageType string) error

InitStorage initializes the storage backend

Types

type AppData

type AppData struct {
	ThemeIndex int      `json:"themeIndex"`
	SortMode   SortMode `json:"sortMode"`
	Tasks      []Task   `json:"tasks"`
}

func LoadData

func LoadData() AppData

type AppState

type AppState int
const (
	StateBrowse AppState = iota
	StateEditing
	StateCreating
	StateSettingTime
)

type Model

type Model struct {
	Tasks      []Task
	State      AppState
	SortMode   SortMode
	ThemeIndex int
	LastAnim   int

	Cursor    int
	Width     int
	Height    int
	TextInput textinput.Model
}

func (*Model) ApplySort

func (m *Model) ApplySort()

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Save

func (m *Model) Save()

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type SortMode

type SortMode int
const (
	SortOff SortMode = iota
	SortTodoFirst
	SortDoneFirst
)

type Task

type Task struct {
	ID       int64     `json:"id"`
	Title    string    `json:"title"`
	Done     bool      `json:"done"`
	DueAt    time.Time `json:"dueAt"`
	Notified bool      `json:"notified"`

	// Animation States
	IsAnimatingCheck bool      `json:"-"`
	IsDeleting       bool      `json:"-"`
	AnimType         int       `json:"-"`
	AnimStart        time.Time `json:"-"`
}

type TickMsg

type TickMsg struct{}

Jump to

Keyboard shortcuts

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