todo

package module
v0.0.0-...-2c1608f Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: MIT Imports: 11 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(msg string) error

Confirm wraps a message and asks for confirm

func FindItem

func FindItem(items []Item, ID int) (index int, err error)

FindItem finds an item with ID

func InitJSON

func InitJSON(name string) error

InitJSON creates an empty todo list file

func NextID

func NextID(items []Item) int

NextID gets the next available ID

func PrintDetailed

func PrintDetailed(i Item) error

PrintDetailed dumps info from item

func PrintItems

func PrintItems(items []Item, verbose bool) error

PrintItems dumps a slice of items, optionally being a bit more verbose

func ReadDetails

func ReadDetails(r *bufio.Reader) (string, error)

ReadDetails reads details from a specfied Reader

func WriteJSON

func WriteJSON(items []Item, name string) (err error)

WriteJSON writes Item slice to file

Types

type Item

type Item struct {
	ID       int    `json:"id"`
	Message  string `json:"message"`
	Details  string `json:"detail"`
	Category string `json:"category"`
	Priority int    `json:"priority"`
}

Item represents an individual item in the todo list.

func ReadItem

func ReadItem() (i Item, err error)

ReadItem fills item with input from stderr

func ReadJSON

func ReadJSON(name string) ([]Item, error)

ReadJSON converts json into Item slice

Directories

Path Synopsis
cmd
todo
Todo is a list management tool.
Todo is a list management tool.

Jump to

Keyboard shortcuts

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