taskboard

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package taskboard provides lightweight task management for TUI

Index

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

func NewFileStore(filePath string) (*FileStore, error)

NewFileStore creates a new file-based task store

func (*FileStore) Create

func (f *FileStore) Create(ctx context.Context, task *Task) (*Task, error)

Create creates a new task

func (*FileStore) Delete

func (f *FileStore) Delete(ctx context.Context, id int) error

Delete removes a task by ID

func (*FileStore) FilePath

func (f *FileStore) FilePath() string

FilePath returns the path to the task file

func (*FileStore) Get

func (f *FileStore) Get(ctx context.Context, id int) (*Task, error)

Get returns a task by ID

func (*FileStore) List

func (f *FileStore) List(ctx context.Context) ([]*Task, error)

List returns all tasks sorted by ID (ascending)

func (*FileStore) Reload

func (f *FileStore) Reload() error

Reload reloads tasks from the file (for external changes)

func (*FileStore) Update

func (f *FileStore) Update(ctx context.Context, task *Task) error

Update updates an existing task

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) Create

func (m *MemoryStore) Create(ctx context.Context, task *Task) (*Task, error)

Create creates a new task

func (*MemoryStore) Delete

func (m *MemoryStore) Delete(ctx context.Context, id int) error

Delete removes a task by ID

func (*MemoryStore) Get

func (m *MemoryStore) Get(ctx context.Context, id int) (*Task, error)

Get returns a task by ID

func (*MemoryStore) List

func (m *MemoryStore) List(ctx context.Context) ([]*Task, error)

List returns all tasks sorted by ID (ascending)

func (*MemoryStore) Update

func (m *MemoryStore) Update(ctx context.Context, task *Task) error

Update updates an existing task

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

type Status

type Status string

Status represents task status

const (
	StatusPending    Status = "pending"
	StatusInProgress Status = "in_progress"
	StatusCompleted  Status = "completed"
)

type Task

type Task struct {
	ID          int
	Title       string
	Assignee    string
	Status      Status
	Description string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

Task represents a lightweight task for team status display

Jump to

Keyboard shortcuts

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