cmd

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

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_NAME = "db.json"
)

Variables

This section is empty.

Functions

func HandleAdd

func HandleAdd(ctx *cli.Context) error

func HandleDelete

func HandleDelete(ctx *cli.Context) error

func HandleDeleteDone

func HandleDeleteDone(ctx *cli.Context) error

func HandleDeleteInProgress

func HandleDeleteInProgress(ctx *cli.Context) error

func HandleDeleteTodo

func HandleDeleteTodo(ctx *cli.Context) error

func HandleList

func HandleList(ctx *cli.Context) error

func HandleListDone

func HandleListDone(ctx *cli.Context) error

func HandleListInProgress

func HandleListInProgress(ctx *cli.Context) error

func HandleListTodo

func HandleListTodo(ctx *cli.Context) error

func HandleMarkDone

func HandleMarkDone(ctx *cli.Context) error

func HandleMarkInProgress

func HandleMarkInProgress(ctx *cli.Context) error

func HandleUpdate

func HandleUpdate(ctx *cli.Context) error

func Load

func Load(ctx *cli.Context) error

Loads a saved JSON database, if it exists

func New

func New() *cli.App

func Save

func Save(ctx *cli.Context) error

Saves all tasks to a JSON file

Types

type Task

type Task struct {
	CreatedAt   time.Time  `json:"createdAt"`
	UpdatedAt   time.Time  `json:"updatedAt"`
	Description string     `json:"desc"`
	Id          uint64     `json:"id"`
	Status      TaskStatus `json:"status"`
}

func (Task) String

func (t Task) String(verbose bool) string

type TaskStatus

type TaskStatus int
const (
	STATUS_TODO        TaskStatus = 0
	STATUS_IN_PROGRESS TaskStatus = 1
	STATUS_DONE        TaskStatus = 2
)

func (TaskStatus) String

func (s TaskStatus) String() string

type Tasks

type Tasks struct {
	Tasks map[uint64]Task `json:"tasks"`
}

Jump to

Keyboard shortcuts

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