Documentation ¶
Index ¶
- Constants
- Variables
- func AddTaskPrompt(shelf TaskShelf)
- func GetDefualtSave() string
- func GetTaskNames(t []Task) []string
- func InitialModel() model
- type FilesystemShelf
- func (f *FilesystemShelf) AddTask(title string, desc string, priority int, due time.Time)
- func (f *FilesystemShelf) Clean() int
- func (f *FilesystemShelf) DeleteTask(id int)
- func (f *FilesystemShelf) GetAll() []Task
- func (f *FilesystemShelf) MarkDone(id int) string
- func (f *FilesystemShelf) ModifyDesc(id int, desc string)
- func (f *FilesystemShelf) ModifyDue(id int, due time.Time)
- func (f *FilesystemShelf) ModifyPriority(id int, pri int)
- func (f *FilesystemShelf) ModifyTitle(id int, title string)
- func (t *FilesystemShelf) RenderTask(task Task) string
- func (f *FilesystemShelf) ResetDone(id int)
- type HeaderData
- type Option
- type ShelfHome
- type Task
- type TaskShelf
- type TimeToSunShift
- type UserDetails
- type UserImplementation
Constants ¶
const AUTUMN_EQUINOX = 265
const FS_SAVE_LOCATION = "./todo.ta"
const HEADER_TEMPLATE = `` /* 257-byte string literal not displayed */
const SHELF_COL_DELIM = " "
const SHELF_LINE_DELIM = "\n---- ---- ---- ----\n"
const SHELF_TEMPLATE = "{{.Id}} {{.Title}} {{.Desc}} {{.Due}} {{.Done}} {{.Priority}}"
const SPRING_EQUINOX = 81
const SUMMER_SOLSTICE = 173
const TASK_ITEM = `` /* 190-byte string literal not displayed */
const TIME_FORMAT = "2006-01-02T15:04:05 -07:00:00"
const TIME_TO_TEMPLATE = `{{.Hours}}H, {{.Minutes}}M`
const WINTER_SOLSTICE = 356
Variables ¶
var Quarters = []int{ SPRING_EQUINOX, SUMMER_SOLSTICE, AUTUMN_EQUINOX, WINTER_SOLSTICE, }
Functions ¶
func GetDefualtSave ¶
func GetDefualtSave() string
func GetTaskNames ¶
Grab all of the names of the tasks from the TaskShelf
:param t: a list of Task structs :returns: A list of the task names
func InitialModel ¶
func InitialModel() model
Types ¶
type FilesystemShelf ¶
type FilesystemShelf struct { SaveLocation string Template *template.Template TaskTempl *template.Template Tasks []Task }
func NewFilesystemShelf ¶
func NewFilesystemShelf(save string) *FilesystemShelf
Create a new filesystem shelf struct to reflect the filesystem shelf
:param save: the save location to store the shelf in :returns: a pointer to a FilesystemShelf struct
func (*FilesystemShelf) AddTask ¶
Add a task to the filesystem shelf
:param title: the title to give the task :param desc: the description to give the task :param priority: the priority to give the task :param due: the due date for the task :returns: Nothing
func (*FilesystemShelf) Clean ¶
func (f *FilesystemShelf) Clean() int
Clean the filesystem shelf of all completed tasks
func (*FilesystemShelf) DeleteTask ¶
func (f *FilesystemShelf) DeleteTask(id int)
func (*FilesystemShelf) GetAll ¶
func (f *FilesystemShelf) GetAll() []Task
Retrieve all the tasks from the filesystem shelf
func (*FilesystemShelf) MarkDone ¶
func (f *FilesystemShelf) MarkDone(id int) string
Mark task as done and write the shelf to disk. since the Tasks within FilesystemShelf are values and not pointers, we need to copy the entirety of the shelf over to a new set and write it, as opposed to just modifying the pointer and then writing.
:param id: the ID of the task to mark as done :returns: Nothing
func (*FilesystemShelf) ModifyDesc ¶
func (f *FilesystemShelf) ModifyDesc(id int, desc string)
func (*FilesystemShelf) ModifyDue ¶
func (f *FilesystemShelf) ModifyDue(id int, due time.Time)
Boiler plate so i can implement later
func (*FilesystemShelf) ModifyPriority ¶
func (f *FilesystemShelf) ModifyPriority(id int, pri int)
func (*FilesystemShelf) ModifyTitle ¶
func (f *FilesystemShelf) ModifyTitle(id int, title string)
func (*FilesystemShelf) RenderTask ¶
func (t *FilesystemShelf) RenderTask(task Task) string
func (*FilesystemShelf) ResetDone ¶
func (f *FilesystemShelf) ResetDone(id int)
type HeaderData ¶
type HeaderData struct { Date string Season string DaysToQuarter int QuarterType string DayOfWeek string Time string Meridiem string TtEod TimeToSunShift TtSun TimeToSunShift SunCycle string }
type Option ¶
type Option struct { Name string // the display name in the UI Template *template.Template // The template to render in the Render() func }
func GetOptions ¶
func GetOptions() []Option
Removing this from GetShelfHome to allow for indirecting the data feed
type ShelfHome ¶
func (ShelfHome) OptionList ¶
Return a list of the options as strings for the UI to render
type Task ¶
func GetTaskList ¶
Retrieve all the tasks from the designated TaskShelf
type TaskShelf ¶
type TaskShelf interface { // Modify the due date of an existing task ModifyDue(id int, due time.Time) // Modify the description field of an existing task ModifyDesc(id int, desc string) // Modify the priority of an existing task ModifyPriority(id int, pri int) // modify the title of an existing task ModifyTitle(id int, title string) // delete an existing task from the shelf DeleteTask(id int) // Mark a task as complete MarkDone(id int) string // hopefully you dont need to call this! ;) ResetDone(id int) // Add a task to the shelf AddTask(title string, desc string, priority int, due time.Time) // Retrieve all tasks in the shelf GetAll() []Task // Render a task to a task template RenderTask(task Task) string // Clean the shelf of all completed tasks Clean() int }
type TimeToSunShift ¶
type UserDetails ¶
type UserDetails interface {
// contains filtered or unexported methods
}
type UserImplementation ¶
type UserImplementation struct{}