Documentation ¶
Index ¶
- Variables
- func InitCache() error
- func InitTodosFile() error
- func ParseStatus(s string) (status, error)
- func SaveTodos(todos []*Todo) error
- func SetVar(key, value string) error
- type Todo
- type TodoList
- func (tl *TodoList) AddTodo(t Todo)
- func (tl *TodoList) Display()
- func (tl *TodoList) FindTodo(id uuid.UUID) (*Todo, error)
- func (tl *TodoList) RemoveTodo(id uuid.UUID) (string, error)
- func (tl *TodoList) UpdateTodoDescription(id uuid.UUID, newDescription string) error
- func (tl *TodoList) UpdateTodoStatus(id uuid.UUID, newStatus status) error
- func (tl *TodoList) UpdateTodoTitle(id uuid.UUID, newTitle string) error
- type Vars
Constants ¶
This section is empty.
Variables ¶
View Source
var CacheFilePath = getCacheFilePath()
Functions ¶
func InitTodosFile ¶
func InitTodosFile() error
InitTodosFile creates the JSON which stores the todos if it does not exist and initialize it with an empty array.
func ParseStatus ¶
Types ¶
type Todo ¶
type Todo struct { ID uuid.UUID `json:"id"` Title string `json:"title"` Description string `json:"description"` Status status `json:"status"` }
func ReadTodosFile ¶
func (*Todo) SetDescription ¶
type TodoList ¶
type TodoList struct {
Todos []*Todo
}
func NewTodoList ¶
func (*TodoList) UpdateTodoDescription ¶
func (*TodoList) UpdateTodoStatus ¶
Click to show internal directories.
Click to hide internal directories.