models

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 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 EntryIdentity added in v0.0.17

type EntryIdentity struct {
	EntryType LogEntryViewType
	ID        int64
}

func (EntryIdentity) IsSet added in v0.0.17

func (c EntryIdentity) IsSet() bool

func (*EntryIdentity) Unset added in v0.0.17

func (c *EntryIdentity) Unset()

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) GetID added in v0.0.17

func (h *Happening) GetID() int64

GetID returns the ID of the happening

func (*Happening) SetID added in v0.0.17

func (h *Happening) SetID(id int64)

SetID sets the ID of the happening

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) Append added in v0.0.25

func (c *InputState) Append(content string)

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 LearningMaterial added in v0.0.25

type LearningMaterial struct {
	ID                int64     `json:"id"`
	UserID            int64     `json:"user_id"`
	Title             string    `json:"title"`
	Description       string    `json:"description"`
	Content           string    `json:"content"`
	Source            string    `json:"source"`
	Type              string    `json:"type"`
	Difficulty        string    `json:"difficulty"`
	CreateTime        time.Time `json:"create_time"`
	UpdateTime        time.Time `json:"update_time"`
	LastViewBeginTime time.Time `json:"last_view_begin_time"`
	LastViewEndTime   time.Time `json:"last_view_end_time"`
	Count             int64     `json:"count"`
}

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) GetID added in v0.0.17

func (le *LogEntry) GetID() int64

GetID returns the ID of the log entry

func (*LogEntry) SetID added in v0.0.17

func (le *LogEntry) SetID(id int64)

SetID sets the ID of the log entry

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

	// ViewType indicates whether this is a regular log entry or a group entry
	ViewType LogEntryViewType

	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

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

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

	// for note
	EntryIDForNote int64
}

func (*LogEntryView) Identity added in v0.0.17

func (c *LogEntryView) Identity() EntryIdentity

func (*LogEntryView) SameIdentity added in v0.0.17

func (c *LogEntryView) SameIdentity(target EntryIdentity) bool

type LogEntryViewType added in v0.0.17

type LogEntryViewType string
const (
	LogEntryViewType_Log         LogEntryViewType = "Log"
	LogEntryViewType_Note        LogEntryViewType = "Note"
	LogEntryViewType_FocusedItem LogEntryViewType = "FocusedItem"
	LogEntryViewType_Group       LogEntryViewType = "Group"
)

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) GetID added in v0.0.17

func (n *Note) GetID() int64

GetID returns the ID of the note

func (*Note) SetID added in v0.0.17

func (n *Note) SetID(id int64)

SetID sets the ID of the note

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
)

type State added in v0.0.16

type State struct {
	ID                  int64     `json:"id"`
	Name                string    `json:"name"`
	Description         string    `json:"description"`
	ParentStateRecordID int64     `json:"parent_state_record_id"`
	Score               float64   `json:"score"`
	Scope               string    `json:"scope"`
	CreateTime          time.Time `json:"create_time"`
	UpdateTime          time.Time `json:"update_time"`
}

func (*State) GetID added in v0.0.17

func (s *State) GetID() int64

GetID returns the ID of the state

func (*State) SetID added in v0.0.17

func (s *State) SetID(id int64)

SetID sets the ID of the state

func (*State) Update added in v0.0.16

func (s *State) Update(optional *StateOptional)

type StateEvent added in v0.0.16

type StateEvent struct {
	ID            int64     `json:"id"`
	StateRecordID int64     `json:"state_record_id"`
	RecordData    string    `json:"record_data"`
	DeltaScore    float64   `json:"delta_score"`
	Description   string    `json:"description"`
	Details       string    `json:"details"`
	Scope         string    `json:"scope"`
	CreateTime    time.Time `json:"create_time"`
	UpdateTime    time.Time `json:"update_time"`
}

func (*StateEvent) GetID added in v0.0.17

func (se *StateEvent) GetID() int64

GetID returns the ID of the state event

func (*StateEvent) SetID added in v0.0.17

func (se *StateEvent) SetID(id int64)

SetID sets the ID of the state event

func (*StateEvent) Update added in v0.0.16

func (se *StateEvent) Update(optional *StateEventOptional)

type StateEventOptional added in v0.0.16

type StateEventOptional struct {
	ID            *int64     `json:"id"`
	StateRecordID *int64     `json:"state_record_id"`
	RecordData    *string    `json:"record_data"`
	DeltaScore    *float64   `json:"delta_score"`
	Description   *string    `json:"description"`
	Details       *string    `json:"details"`
	Scope         *string    `json:"scope"`
	CreateTime    *time.Time `json:"create_time"`
	UpdateTime    *time.Time `json:"update_time"`
}

type StateHistoryPoint added in v0.0.23

type StateHistoryPoint struct {
	Date  string  `json:"date"`  // Date in YYYY-MM-DD format
	Score float64 `json:"score"` // Total score on that date
}

StateHistoryPoint represents a single point in state history

type StateOptional added in v0.0.16

type StateOptional struct {
	ID                  *int64     `json:"id"`
	Name                *string    `json:"name"`
	Description         *string    `json:"description"`
	ParentStateRecordID *int64     `json:"parent_state_record_id"`
	Score               *float64   `json:"score"`
	Scope               *string    `json:"scope"`
	CreateTime          *time.Time `json:"create_time"`
	UpdateTime          *time.Time `json:"update_time"`
}

type WordPosition added in v0.0.25

type WordPosition struct {
	Word       string
	LineIndex  int // Which line this word is on
	WordInLine int // Position of word within the line
	StartPos   int // Start position in content string
	EndPos     int // End position in content string
}

WordPosition represents the position of a word in content for reading navigation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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