Documentation
¶
Overview ¶
Package tui provides the default Overmind terminal screen.
Index ¶
- Variables
- func Run(ctx context.Context, listNotes ListNotesFunc, reindex ReindexFunc, ...) error
- func RunSetup(ctx context.Context, defaults appconfig.Settings, path string) (appconfig.Settings, error)
- type CreateBookmarkFunc
- type CreateHabitFunc
- type CreateInboxFunc
- type CreateJournalFunc
- type CreatePageFunc
- type CreatePersonFunc
- type DeleteNoteFunc
- type EditClient
- type EditClientFactory
- type GetJournalFunc
- type ListGroupsFunc
- type ListNotesFunc
- type RawEditClient
- type RawEditClientFactory
- type ReindexFunc
- type UpdateJournalFunc
Constants ¶
This section is empty.
Variables ¶
var ErrSetupCancelled = errors.New("setup cancelled")
ErrSetupCancelled means setup exited without submitting valid settings.
Functions ¶
func Run ¶
func Run( ctx context.Context, listNotes ListNotesFunc, reindex ReindexFunc, deleteNote DeleteNoteFunc, createInbox CreateInboxFunc, createPage CreatePageFunc, createBookmark CreateBookmarkFunc, createJournal CreateJournalFunc, getJournal GetJournalFunc, updateJournal UpdateJournalFunc, createHabit CreateHabitFunc, createPerson CreatePersonFunc, listGroups ListGroupsFunc, newEditClient EditClientFactory, newRawEditClient RawEditClientFactory, ) error
Run opens the TUI with application callbacks and restores the terminal on exit. Unfinished raw-edit drafts are retained and their paths are reported afterward.
func RunSetup ¶ added in v0.4.0
func RunSetup(ctx context.Context, defaults appconfig.Settings, path string) (appconfig.Settings, error)
RunSetup opens the shared form with editable defaults and returns the submitted settings. The CLI creates the configuration only after this form has completed successfully.
Types ¶
type CreateBookmarkFunc ¶ added in v0.4.0
type CreateBookmarkFunc func(context.Context, bookmark.CreateCommand) (bookmark.CreateResult, error)
CreateBookmarkFunc connects form submissions to the bookmark creation use case.
type CreateHabitFunc ¶ added in v0.4.0
type CreateHabitFunc func(context.Context, habit.CreateCommand) (habit.CreateResult, error)
CreateHabitFunc connects form submissions to the habit creation use case.
type CreateInboxFunc ¶ added in v0.4.0
type CreateInboxFunc func(context.Context, inbox.CreateCommand) (inbox.CreateResult, error)
CreateInboxFunc connects form submissions to the inbox creation use case.
type CreateJournalFunc ¶ added in v0.4.0
type CreateJournalFunc func(context.Context, appjournal.CreateCommand) (appjournal.CreateResult, error)
CreateJournalFunc connects form submissions to the journal creation use case.
type CreatePageFunc ¶ added in v0.4.0
type CreatePageFunc func(context.Context, page.CreateCommand) (page.CreateResult, error)
CreatePageFunc connects form submissions to the page creation use case.
type CreatePersonFunc ¶ added in v0.4.0
type CreatePersonFunc func(context.Context, person.CreateCommand) (person.CreateResult, error)
CreatePersonFunc connects form submissions to the person creation use case.
type DeleteNoteFunc ¶ added in v0.3.0
type DeleteNoteFunc func(context.Context, notes.DeleteCommand) (notes.DeleteResult, error)
DeleteNoteFunc removes the selected source document and its index projection.
type EditClient ¶ added in v0.4.0
type EditClient interface {
// GetHabit loads and verifies the requested habit document.
GetHabit(context.Context, habit.GetQuery) (habit.GetResult, error)
// UpdateHabit replaces editable habit values while preserving identity and creation time.
UpdateHabit(context.Context, habit.UpdateCommand) (habit.UpdateResult, error)
// GetPerson loads and verifies the requested person document.
GetPerson(context.Context, person.GetQuery) (person.GetResult, error)
// UpdatePerson replaces editable person values while preserving identity and creation time.
UpdatePerson(context.Context, person.UpdateCommand) (person.UpdateResult, error)
// GetBookmark loads and verifies the requested bookmark document.
GetBookmark(context.Context, bookmark.GetQuery) (bookmark.GetResult, error)
// UpdateBookmark replaces editable bookmark values while preserving identity and creation time.
UpdateBookmark(context.Context, bookmark.UpdateCommand) (bookmark.UpdateResult, error)
// GetInbox loads and verifies the requested inbox document.
GetInbox(context.Context, inbox.GetQuery) (inbox.GetResult, error)
// UpdateInbox replaces editable inbox values while preserving identity and creation time.
UpdateInbox(context.Context, inbox.UpdateCommand) (inbox.UpdateResult, error)
// GetPage loads and verifies the requested page document.
GetPage(context.Context, page.GetQuery) (page.GetResult, error)
// UpdatePage replaces editable page values while preserving identity and creation time.
UpdatePage(context.Context, page.UpdateCommand) (page.UpdateResult, error)
// GetJournal loads and verifies the requested journal document.
GetJournal(context.Context, journal.GetQuery) (journal.GetResult, error)
// UpdateJournal replaces editable journal values while preserving identity and creation time.
UpdateJournal(context.Context, journal.UpdateCommand) (journal.UpdateResult, error)
}
EditClient supplies the typed operations used by the shared edit forms.
type EditClientFactory ¶ added in v0.4.0
type EditClientFactory func(context.Context) (EditClient, error)
EditClientFactory resolves the typed client for loading and saving note forms.
type GetJournalFunc ¶ added in v0.4.0
type GetJournalFunc func(context.Context, appjournal.GetQuery) (appjournal.GetResult, error)
GetJournalFunc loads the document selected for today's journal.
type ListGroupsFunc ¶ added in v0.4.0
type ListGroupsFunc func(context.Context, person.ListGroupsQuery) (person.ListGroupsResult, error)
ListGroupsFunc provides existing group names for person membership selection.
type ListNotesFunc ¶ added in v0.3.0
ListNotesFunc lets the TUI query notes through a local or remote client.
type RawEditClient ¶ added in v0.4.0
type RawEditClient interface {
// GetRawNote loads managed source without requiring a valid body.
GetRawNote(context.Context, rawedit.GetQuery) (rawedit.GetResult, error)
// UpdateRawNote validates and saves source, reporting partial index failures.
UpdateRawNote(context.Context, rawedit.UpdateCommand) (rawedit.UpdateResult, error)
}
RawEditClient supplies source reads and validated writes; the TUI owns only the external-editor process and its private draft files.
type RawEditClientFactory ¶ added in v0.4.0
type RawEditClientFactory func(context.Context) (RawEditClient, error)
RawEditClientFactory resolves the client when a raw-edit operation starts.
type ReindexFunc ¶ added in v0.3.0
type ReindexFunc func(context.Context, notes.ReindexCommand) (notes.ReindexResult, error)
ReindexFunc rebuilds searchable projections from the vault documents.
type UpdateJournalFunc ¶ added in v0.4.0
type UpdateJournalFunc func(context.Context, appjournal.UpdateCommand) (appjournal.UpdateResult, error)
UpdateJournalFunc persists journal content and tags without changing its date.