models

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LastInput  string `json:"last_input"`
	RunningPID int    `json:"running_pid"`
	// value: sqlite(default), file, server
	StorageType string `json:"storage_type,omitempty"`

	// server_addr and server_token are only used when storage_type is server
	ServerAddr  string `json:"server_addr,omitempty"`
	ServerToken string `json:"server_token,omitempty"`
}

type EntryOnDetailPage

type EntryOnDetailPage struct {
	SelectedNoteID int64

	SelectedNoteMode SelectedNoteMode

	InputState InputState

	EditInputState InputState

	ConfirmDeleteButton int

	SelectedChildEntryID int64
}

type Happening added in v0.0.15

type Happening struct {
	ID         int64     `json:"id"`
	Content    string    `json:"content"`
	CreateTime time.Time `json:"create_time"`
	UpdateTime time.Time `json:"update_time"`
}

func (*Happening) Update added in v0.0.15

func (c *Happening) Update(optional *HappeningOptional)

type HappeningOptional added in v0.0.15

type HappeningOptional struct {
	ID         *int64     `json:"id"`
	Content    *string    `json:"content"`
	CreateTime *time.Time `json:"create_time"`
	UpdateTime *time.Time `json:"update_time"`
}

type InputState

type InputState struct {
	Value          string
	Focused        bool
	CursorPosition int
	LastInputEvent *dom.DOMEvent
	LastInputTime  time.Time
}

func (*InputState) FocusWithText added in v0.0.6

func (c *InputState) FocusWithText(text string)

func (*InputState) Reset added in v0.0.4

func (c *InputState) Reset()

type LogEntry

type LogEntry struct {
	ID              int64      `json:"id"`
	Text            string     `json:"text"`
	Done            bool       `json:"done"`
	DoneTime        *time.Time `json:"done_time"`
	CreateTime      time.Time  `json:"create_time"`
	UpdateTime      time.Time  `json:"update_time"`
	AdjustedTopTime int64      `json:"adjusted_top_time"`
	HighlightLevel  int        `json:"highlight_level"`
	Collapsed       bool       `json:"collapsed"`
	ParentID        int64      `json:"parent_id"`
}

func (*LogEntry) Update added in v0.0.3

func (c *LogEntry) Update(optional *LogEntryOptional)

type LogEntryLegacy

type LogEntryLegacy struct {
	Timestamp time.Time `json:"timestamp"`
	EventType string    `json:"event_type"`
	TodoID    int       `json:"todo_id"`
	TodoData  LogEntry  `json:"todo_data"`
}

type LogEntryOptional

type LogEntryOptional struct {
	ID              *int64      `json:"id"`
	Text            *string     `json:"text"`
	Done            *bool       `json:"done"`
	DoneTime        **time.Time `json:"done_time"`
	CreateTime      *time.Time  `json:"create_time"`
	UpdateTime      *time.Time  `json:"update_time"`
	AdjustedTopTime *int64      `json:"adjusted_top_time"`
	HighlightLevel  *int        `json:"highlight_level"`
	Collapsed       *bool       `json:"collapsed"`
	ParentID        *int64      `json:"parent_id"`
}

type LogEntryView added in v0.0.4

type LogEntryView struct {
	Data *LogEntry

	MatchTexts []MatchText

	DetailPage *EntryOnDetailPage

	Notes    []*NoteView
	Children LogEntryViews

	// IncludeHistory controls whether history children are included
	// When true, shows (*) indicator and displays all children including history
	// toggled by 'v' command (also implies notes display in UI rendering)
	IncludeHistory bool

	// IncludeNotes controls whether notes are shown for this entry and its subtree
	// When true, shows notes for this entry and all its descendants
	// toggled by 'n' command (UI also shows notes when IncludeHistory is true)
	IncludeNotes bool

	// CollapsedChildren stores the original children when entry is collapsed
	CollapsedChildren LogEntryViews

	// CollapsedCount stores the total count of collapsed children (including nested)
	CollapsedCount int
}

type LogEntryViews added in v0.0.4

type LogEntryViews []*LogEntryView

func (LogEntryViews) FindNext added in v0.0.4

func (list LogEntryViews) FindNext(id int64) *LogEntryView

func (LogEntryViews) FindNextOrLast added in v0.0.4

func (list LogEntryViews) FindNextOrLast(id int64) *LogEntryView

func (LogEntryViews) FindPrev added in v0.0.4

func (list LogEntryViews) FindPrev(id int64) *LogEntryView

func (LogEntryViews) FindPrevOrFirst added in v0.0.4

func (list LogEntryViews) FindPrevOrFirst(id int64) *LogEntryView

func (LogEntryViews) Get added in v0.0.4

func (list LogEntryViews) Get(id int64) *LogEntryView

type MatchText added in v0.0.4

type MatchText struct {
	Text  string
	Match bool
}

type Note

type Note struct {
	ID         int64     `json:"id"`
	EntryID    int64     `json:"entry_id"`
	Text       string    `json:"text"`
	CreateTime time.Time `json:"create_time"`
	UpdateTime time.Time `json:"update_time"`
}

func (*Note) Update added in v0.0.6

func (c *Note) Update(optional *NoteOptional)

type NoteOptional

type NoteOptional struct {
	ID         *int64     `json:"id"`
	EntryID    *int64     `json:"entry_id"`
	Text       *string    `json:"text"`
	CreateTime *time.Time `json:"create_time"`
	UpdateTime *time.Time `json:"update_time"`
}

type NoteView

type NoteView struct {
	Data       *Note
	MatchTexts []MatchText
}

type SelectedNoteMode added in v0.0.5

type SelectedNoteMode int
const (
	SelectedNoteMode_Default SelectedNoteMode = iota
	SelectedNoteMode_Editing
	SelectedNoteMode_Deleting
)

Jump to

Keyboard shortcuts

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