Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigDir() string
- func CreateStoreFile() (*os.File, error)
- func DefaultFile() string
- func DisplayLists(rds []io.Reader) error
- func GetDefaultStoreFilePath() string
- func GetListsByPath(path string) ([]io.Reader, error)
- func GetStoreFile() (*os.File, error)
- func GetSystemConfigPath() string
- func MakeStoreFilePath(name string) string
- func ResolveDoneColor(st bool) string
- func SetStoreFileName(name string)
- func SortItems(items []Item, wr io.Writer) error
- func StoreFileName() string
- func Truncate(wr io.Writer) error
- func Version() string
- type Item
- type List
Constants ¶
const ( // ItemStatusCompleted identifies item as done. ItemStatusCompleted = true // ItemStatusIncompleted identifies item as incomplete.. ItemStatusIncompleted = false )
Variables ¶
var Color = struct { Blue string Green string Yellow string Red string Nul string }{ Blue: "\033[94m", Green: "\033[92m", Yellow: "\033[93m", Red: "\033[91m", Nul: "\033[0m", }
Color contains some colors for terminal representation.
Functions ¶
func ConfigDir ¶ added in v1.0.8
func ConfigDir() string
ConfigDir gets the gops name in config directory.
func CreateStoreFile ¶ added in v1.0.8
CreateStoreFile create store file if not exists.
func DefaultFile ¶ added in v1.0.8
func DefaultFile() string
DefaultFile gets default file name in config directory.
func GetDefaultStoreFilePath ¶ added in v1.0.8
func GetDefaultStoreFilePath() string
GetDefaultStoreFilePath gets default file to store items.
func GetListsByPath ¶ added in v1.0.8
GetListsByPath gets all list by given path in file system.
func GetStoreFile ¶ added in v1.0.8
GetStoreFile resolves the file to store todo items on file system.
func GetSystemConfigPath ¶ added in v1.0.12
func GetSystemConfigPath() string
GetSystemConfigPath gets config directory, on Linux usually $HOME/.config
func MakeStoreFilePath ¶ added in v1.0.8
MakeStoreFilePath makes path to store file.
func ResolveDoneColor ¶ added in v1.0.10
ResolveDoneColor gets the done item color.
func SetStoreFileName ¶ added in v1.0.8
func SetStoreFileName(name string)
SetStoreFileName set store file name where items are written.
func SortItems ¶ added in v1.0.10
SortItems sorts the items by date and the by status, completed items are going to bottom.
func StoreFileName ¶ added in v1.0.8
func StoreFileName() string
StoreFileName gets the file name where items are written.
Types ¶
type Item ¶
Item represents a todo item.
func CompleteItem ¶
CompleteItem sets the status of a todo item to complete and writes it to file.
func FilterItemsByStatus ¶
FilterItemsByStatus filters the todo items by status completed or incomplete.
func (*Item) BeautifulString ¶
BeautifulString returns string to output with colors.