task

package
v0.0.0-...-5a4b634 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrentTaskKey = []byte("current")
)

Functions

func NewStore

func NewStore(path string) (*store, error)

Types

type FilterTask

type FilterTask func(t Task) bool

type Status

type Status string
const (
	Pending  Status = "pending"
	Complete        = "complete"
)

type Store

type Store interface {
	Add(title string) (*Task, error)
	Remove(id uuid.UUID) error
	List(filter FilterTask) ([]Task, error)
	SetState(id uuid.UUID, status Status) (*Task, error)
	AddSessions(id uuid.UUID) (*Task, error)

	ClearCurrentTask(id uuid.UUID) error
	SetCurrentTask(id uuid.UUID) error
	GetCurrentTask() (task *Task, err error)
}

type Task

type Task struct {
	ID        uuid.UUID  `json:"id"`
	Title     string     `json:"title"`
	Status    Status     `json:"status"`
	Sessions  int        `json:"sessions"`
	CreatedAT time.Time  `json:"created_at"`
	UpdatedAT *time.Time `json:"updated_at"`
}

func NewTask

func NewTask(title string) *Task

func (Task) Describe

func (t Task) Describe() string

func (Task) Format

func (t Task) Format() string

func (Task) Key

func (t Task) Key() []byte

Jump to

Keyboard shortcuts

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