handlers

package
v0.0.0-...-bb1094a Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListBooks

func ListBooks(ctx context.Context, args []string) error

ListBooks lists all books in the queue

func Reset

func Reset(ctx context.Context, args []string) error

Reset recreates the database and configuration (destructive)

func SearchAndAdd

func SearchAndAdd(ctx context.Context, args []string) error

SearchAndAdd searches for books and allows user to select and add to queue

func SearchAndAddWithOptions

func SearchAndAddWithOptions(ctx context.Context, args []string, interactive bool) error

SearchAndAddWithOptions searches for books with interactive option

func Setup

func Setup(ctx context.Context, args []string) error

Setup initializes the application database and configuration

func Status

func Status(ctx context.Context, args []string) error

Status shows the current application status

func UpdateBookProgress

func UpdateBookProgress(ctx context.Context, args []string) error

UpdateBookProgress updates a book's reading progress percentage

func UpdateBookStatus

func UpdateBookStatus(ctx context.Context, args []string) error

Types

type BookHandler

type BookHandler struct {
	// contains filtered or unexported fields
}

BookHandler handles all book-related commands

func NewBookHandler

func NewBookHandler() (*BookHandler, error)

NewBookHandler creates a new book handler

func (*BookHandler) Close

func (h *BookHandler) Close() error

Close cleans up resources

type NoteHandler

type NoteHandler struct {
	// contains filtered or unexported fields
}

NoteHandler handles all note-related commands

func NewNoteHandler

func NewNoteHandler() (*NoteHandler, error)

NewNoteHandler creates a new note handler

func (*NoteHandler) Close

func (h *NoteHandler) Close() error

Close cleans up resources

func (*NoteHandler) Create

func (h *NoteHandler) Create(ctx context.Context, title string, content string, filePath string, interactive bool) error

Create handles note creation with optional title, content, and file path

func (*NoteHandler) Delete

func (h *NoteHandler) Delete(ctx context.Context, id int64) error

Delete permanently removes a note and its metadata

func (*NoteHandler) Edit

func (h *NoteHandler) Edit(ctx context.Context, id int64) error

Edit handles note editing by ID

func (*NoteHandler) List

func (h *NoteHandler) List(ctx context.Context, static, showArchived bool, tags []string) error

List opens either an interactive TUI browser for navigating and viewing notes or a static list

func (*NoteHandler) View

func (h *NoteHandler) View(ctx context.Context, id int64) error

View displays a note with formatted markdown content

type SeedHandler

type SeedHandler struct {
	// contains filtered or unexported fields
}

SeedHandler handles database seeding operations

func NewSeedHandler

func NewSeedHandler() (*SeedHandler, error)

NewSeedHandler creates a new seed handler

func (*SeedHandler) Close

func (h *SeedHandler) Close() error

Close cleans up resources

func (*SeedHandler) Seed

func (h *SeedHandler) Seed(ctx context.Context, force bool) error

Seed populates the database with test data for demonstration and testing

type TaskHandler

type TaskHandler struct {
	// contains filtered or unexported fields
}

TaskHandler handles all task-related commands

func NewTaskHandler

func NewTaskHandler() (*TaskHandler, error)

NewTaskHandler creates a new task handler

func (*TaskHandler) Close

func (h *TaskHandler) Close() error

Close cleans up resources

func (*TaskHandler) Create

func (h *TaskHandler) Create(ctx context.Context, desc []string, priority, project, due string, tags []string) error

Create creates a new task

func (*TaskHandler) Delete

func (h *TaskHandler) Delete(ctx context.Context, args []string) error

Delete deletes a task

func (*TaskHandler) Done

func (h *TaskHandler) Done(ctx context.Context, args []string) error

Done marks a task as completed

func (*TaskHandler) EditInteractive

func (h *TaskHandler) EditInteractive(ctx context.Context, taskID string) error

EditInteractive opens an interactive task editor with status picker and priority toggle

func (*TaskHandler) List

func (h *TaskHandler) List(ctx context.Context, static, showAll bool, status, priority, project string) error

List lists all tasks with optional filtering

func (*TaskHandler) ListProjects

func (h *TaskHandler) ListProjects(ctx context.Context, static bool) error

ListProjects lists all projects with their task counts

func (*TaskHandler) ListTags

func (h *TaskHandler) ListTags(ctx context.Context, static bool) error

ListTags lists all tags with their task counts

func (*TaskHandler) Start

func (h *TaskHandler) Start(ctx context.Context, taskID string, description string) error

Start starts time tracking for a task

func (*TaskHandler) Stop

func (h *TaskHandler) Stop(ctx context.Context, taskID string) error

Stop stops time tracking for a task

func (*TaskHandler) Timesheet

func (h *TaskHandler) Timesheet(ctx context.Context, days int, taskID string) error

Timesheet shows time tracking summary

func (*TaskHandler) Update

func (h *TaskHandler) Update(ctx context.Context, taskID, description, status, priority, project, due string, addTags, removeTags []string) error

Update updates a task using parsed flag values

func (*TaskHandler) View

func (h *TaskHandler) View(ctx context.Context, args []string, format string, jsonOutput, noMetadata bool) error

View displays a single task

Jump to

Keyboard shortcuts

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