todolist

package module
v0.0.0-...-46e3b5f Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: AGPL-3.0 Imports: 29 Imported by: 0

README

TodoList

A prototype To Do list / note-taking app.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInsert       = errors.New("insert failed")
	ErrLabelID      = errors.New("invalid label ID")
	ErrNotFound     = errors.New("no document found")
	ErrProjectID    = errors.New("invalid project ID")
	ErrSectionID    = errors.New("invalid section ID")
	ErrTableMissing = errors.New("database table missing")
	ErrTaskID       = errors.New("invalid task ID")
)

Functions

func AddLabel

func AddLabel(projectID *uint64, name string)

func AddSection

func AddSection(projectId uint64, section Section) (sectionId uint64, _ error)

func FromHex6

func FromHex6(color string) (clr.C16, error)

FromHex6 converts a 4-digit hexadecimal string into a 16-bit color.

FromHex6("#F60F")

Types

type ID

type ID uint64

func (ID) String

func (d ID) String() string

func (ID) ToKey

func (d ID) ToKey() (key []byte)

type Label

type Label struct {
	ID       uint64
	Name     string
	Created  time.Time
	Modified time.Time
}

type Labels

type Labels []Label

type Priority

type Priority int8
const (
	VeryLow Priority = iota - 2
	Low
	Normal
	Medium
	MediumHigh
	High
	VeryHigh
	Urgent
	Critical
)

type Project

type Project struct {
	ID            uint64
	Name          string
	Description   string
	Created       time.Time
	Parent        uint64
	Color         clr.C16
	Icon          []byte
	Hidden        bool
	Trashed       bool
	Labels        Labels // Unique labels in each project.
	SortOrder     uint64 // Order that projects are displayed in.
	Tasks         Tasks
	Sections      Sections
	UnfinishedQty uint16
}

func AddProject

func AddProject(name string, color clr.C16) (_ *Project, id uint64)

func ProjectById

func ProjectById(id uint64) (*Project, error)

func ProjectGet

func ProjectGet(id ID) (*Project, error)

func (*Project) AddTask

func (p *Project) AddTask(t Task)

func (*Project) Delete

func (p *Project) Delete()

func (*Project) HasLabel

func (p *Project) HasLabel(name string) bool

func (*Project) Hide

func (p *Project) Hide()

func (*Project) MarshalJ

func (p *Project) MarshalJ() []byte

func (*Project) SetColor

func (p *Project) SetColor(c clr.C16)

func (*Project) SetOrder

func (p *Project) SetOrder(o uint64)

func (*Project) UnmarshalJ

func (p *Project) UnmarshalJ(b []byte) error

type Projects

type Projects []Project

func ProjectsGet

func ProjectsGet() Projects

func (Projects) Sort

func (p Projects) Sort() Projects

type Section

type Section struct {
	Id      uint64
	Name    string
	Color   clr.C16
	Project *Project
	Order   uint64
}

type Sections

type Sections []Section

type Server

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

Server configuration options.

func NewServer

func NewServer(host string, port uint16, autoStartBrowser bool) *Server

func (Server) Run

func (svr Server) Run()

type Task

type Task struct {
	ID          uint64
	Name        string
	Description string
	Due         dateTime
	Updated     dateTime
	Created     dateTime
	Project     *Project
	Section     *Section
	Parent      uint64 // Project ID - for subtasks in different projects?
	Priority
	Labels    Labels
	Reminders []time.Time
	// Location	// Reminder when you reach a location.
	SubTasks  Tasks
	Completed time.Time // When the task was completed. Handy for correcting when tasks were completed in the past.
	Done      bool      // If the task is complete or not
	Ignore    bool      // If the task was not completed in time or no longer needed. (hidden from the task list but isn't removed from calendar)
}

func (*Task) SetPriority

func (t *Task) SetPriority(p Priority)

SetPriority validates the priority value is correct.

type Tasks

type Tasks []Task

func GetTasksCompleted

func GetTasksCompleted() Tasks

func GetTasksUncompleted

func GetTasksUncompleted() Tasks

func GetUpcoming

func GetUpcoming() Tasks

func TasksGet

func TasksGet() Tasks

Directories

Path Synopsis
cmd
todolist command

Jump to

Keyboard shortcuts

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