storage

package
v0.0.0-...-521ab5a Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(task Task) (int64, error)

func Count

func Count(filters []sql_builder.Filter) (int, error)

func Delete

func Delete(filters []sql_builder.Filter) ([]int, error)

func Edit

func Edit(filters []sql_builder.Filter, edits []QueryEdit) ([]int, error)

Types

type QueryEdit

type QueryEdit struct {
	Path  string
	Value string
}

type Task

type Task struct {
	// The unique identifier for the task
	Id string
	// A short numerical identifier for the task, used for quick reference in the UI.
	ShortId int
	// The parent recurrence template the task was created from (if any). This
	// is used when finding other tasks from the same recurrence template or
	// when modifying the recurrence options.
	TemplateId string
	// The title of the task
	Title string `json:"title"`
	// The priority of the task, typically something like `H`, `M`, or `L`,
	// though the values are user-defined.
	Priority string `json:"priority"`
	// The status of the task, one of `pending`, `active`, or `done`. Tasks
	// start as `pending`, and can move between `active`, `pending`, and `done`
	// as the user sees fit. Typically a task does not move from done to the
	// other statuses, but it is not enforced.
	Status TaskStatus `json:"status"`
	// A list of tags for the task. Tags are useful for grouping tasks together
	// and can be used to filter tasks in the UI.
	Tags []string `json:"tags"`
	// The time the task was created
	CreatedAt time.Time `json:"created_at"`
	// The time the task was last updated
	UpdatedAt time.Time `json:"updated_at"`
}

func ListTasks

func ListTasks(filters []sql_builder.Filter) ([]Task, error)

func NewTask

func NewTask() Task

type TaskStatus

type TaskStatus string
const (
	TaskStatusPending TaskStatus = "pending"
	TaskStatusActive  TaskStatus = "active"
	TaskStatusDone    TaskStatus = "done"
)

Jump to

Keyboard shortcuts

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