Documentation
¶
Overview ¶
Package taskboard provides lightweight task management for TUI
Index ¶
- Variables
- func DefaultTaskFilePath() string
- type FileStore
- func (f *FileStore) Create(ctx context.Context, task *Task) (*Task, error)
- func (f *FileStore) Delete(ctx context.Context, id int) error
- func (f *FileStore) FilePath() string
- func (f *FileStore) Get(ctx context.Context, id int) (*Task, error)
- func (f *FileStore) List(ctx context.Context) ([]*Task, error)
- func (f *FileStore) Reload() error
- func (f *FileStore) Update(ctx context.Context, task *Task) error
- type MemoryStore
- func (m *MemoryStore) Create(ctx context.Context, task *Task) (*Task, error)
- func (m *MemoryStore) Delete(ctx context.Context, id int) error
- func (m *MemoryStore) Get(ctx context.Context, id int) (*Task, error)
- func (m *MemoryStore) List(ctx context.Context) ([]*Task, error)
- func (m *MemoryStore) Update(ctx context.Context, task *Task) error
- type Reloader
- type Service
- type Status
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("task not found")
)
Functions ¶
func DefaultTaskFilePath ¶
func DefaultTaskFilePath() string
DefaultTaskFilePath returns the default path for task storage
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore is a file-based implementation of Service
func NewFileStore ¶
NewFileStore creates a new file-based task store
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is an in-memory implementation of Service
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
NewMemoryStore creates a new in-memory task store
func (*MemoryStore) Delete ¶
func (m *MemoryStore) Delete(ctx context.Context, id int) error
Delete removes a task by ID
type Reloader ¶
type Reloader interface {
Reload() error
}
Reloader is an optional interface for services that support reloading from external source
type Service ¶
type Service interface {
// List returns all tasks sorted by ID (ascending)
List(ctx context.Context) ([]*Task, error)
// Get returns a task by ID
Get(ctx context.Context, id int) (*Task, error)
// Create creates a new task and returns it with assigned ID
Create(ctx context.Context, task *Task) (*Task, error)
// Update updates an existing task
Update(ctx context.Context, task *Task) error
// Delete removes a task by ID
Delete(ctx context.Context, id int) error
}
Service defines the interface for task management
Click to show internal directories.
Click to hide internal directories.