Documentation ¶
Index ¶
- Constants
- Variables
- func AddIfNotThere(arr []string, items []string) []string
- func Age(asc bool) lessFunc
- func Context(asc bool) lessFunc
- func CreateDefaultConfig() error
- func Created(asc bool) lessFunc
- func DateSort(asc bool) sortFunc
- func Due(asc bool) lessFunc
- func Effort(asc bool) lessFunc
- func ExecOrder(asc bool) lessFunc
- func GetTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func Id(asc bool) lessFunc
- func IndexScaffold(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func Modified(asc bool) lessFunc
- func Notes(asc bool) lessFunc
- func OrdinalAll(asc bool) lessFunc
- func OrdinalContext(asc bool) lessFunc
- func OrdinalProject(asc bool) lessFunc
- func PrioritySorter(asc bool) lessFunc
- func Project(asc bool) lessFunc
- func RedirectScaffold(w http.ResponseWriter, r *http.Request)
- func RedirectToIndex(w http.ResponseWriter, r *http.Request)
- func SaveTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func Subject(asc bool) lessFunc
- func TodoOptions(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type App
- func (a *App) AddAliasCommand(alias string, command string)
- func (a *App) AddDoneTodo(c *CommandImpl)
- func (a *App) AddNote(c *CommandImpl)
- func (a *App) AddReportCommand(key string, val *Report) *ReportCmd
- func (a *App) AddTodo(c *CommandImpl)
- func (a *App) ArchiveCompleted(c *CommandImpl)
- func (a *App) ArchiveTodo(c *CommandImpl)
- func (a *App) CompleteAndArchive(c *CommandImpl)
- func (a *App) CompleteTodo(c *CommandImpl)
- func (a *App) DeleteNote(c *CommandImpl)
- func (a *App) DeleteTodo(c *CommandImpl)
- func (a *App) EditNote(c *CommandImpl)
- func (a *App) EditTodo(c *CommandImpl)
- func (a *App) EncodeUri(uri string) string
- func (a *App) ExecAlias(c *CommandImpl)
- func (a *App) ExportTodo(c *CommandImpl)
- func (a *App) GarbageCollect(c *CommandImpl)
- func (a *App) ImportTodo(c *CommandImpl)
- func (a *App) InitializeRepo(c *CommandImpl)
- func (a *App) ListContexts(c *CommandImpl)
- func (a *App) ListProjects(c *CommandImpl)
- func (a *App) LoadArchived() error
- func (a *App) LoadPending() error
- func (a *App) NewWebApp(c *CommandImpl)
- func (a *App) Open(c *CommandImpl)
- func (a *App) OrderTodos(c *CommandImpl)
- func (a *App) PrintHelp(c *CommandImpl)
- func (a *App) PrintTodoDetail(c *CommandImpl)
- func (a *App) ProcessCmdLine(input string) Command
- func (a *App) Save()
- func (a *App) SetView(c *CommandImpl)
- func (a *App) Stats(c *CommandImpl)
- func (a *App) Sync(c *CommandImpl)
- func (a *App) TouchTodo(c *CommandImpl)
- func (a *App) UnarchiveTodo(c *CommandImpl)
- func (a *App) UncompleteTodo(c *CommandImpl)
- type ByDate
- type ByUuid
- type Command
- type CommandImpl
- func (c *CommandImpl) AcceptsArgs() bool
- func (c *CommandImpl) AcceptsMods() bool
- func (c *CommandImpl) Exec(a *App)
- func (c *CommandImpl) GetArgs() []string
- func (c *CommandImpl) GetCmd() string
- func (c *CommandImpl) GetFilters() []string
- func (c *CommandImpl) GetMods() []string
- func (c *CommandImpl) SetAcceptsArgs(acceptsArgs bool)
- func (c *CommandImpl) SetAcceptsMods(acceptsMods bool)
- func (c *CommandImpl) SetArgs(args []string)
- func (c *CommandImpl) SetCmd(cmd string)
- func (c *CommandImpl) SetFilters(filters []string)
- func (c *CommandImpl) SetMods(mods []string)
- type Config
- type ConfigStore
- type DateFilter
- func (f *DateFilter) FilterAge(filters []string) ([]*Todo, []string)
- func (f *DateFilter) FilterDateRange(filters []string, regex *regexp.Regexp, dateConvFunc func(*Todo) time.Time) ([]*Todo, []string)
- func (f *DateFilter) FilterDoneDate(filters []string) ([]*Todo, []string)
- func (f *DateFilter) FilterDueDate(filters []string) ([]*Todo, []string)
- func (f *DateFilter) FilterExcludeWaiting() []*Todo
- func (f *DateFilter) FilterExpired() []*Todo
- func (f *DateFilter) FilterIncludeWaiting() []*Todo
- func (f *DateFilter) FilterModDate(filters []string) ([]*Todo, []string)
- func (f *DateFilter) FilterWaiting(filters []string) ([]*Todo, []string)
- type FileStore
- func (f *FileStore) AppendBacklog(filepath string, todos []*Todo)
- func (f *FileStore) DeleteBacklog(filepath string)
- func (f *FileStore) Export(filepath string, todos []*Todo)
- func (f *FileStore) GetBacklogFilepath() string
- func (f *FileStore) Import(filepath string) ([]*Todo, error)
- func (f *FileStore) Initialize()
- func (f *FileStore) LoadArchived() ([]*Todo, error)
- func (f *FileStore) LoadBacklog(filepath string) ([]*Todo, error)
- func (f *FileStore) LoadPending() ([]*Todo, error)
- func (f *FileStore) Save(todos []*Todo)
- type OpenTask
- type Parser
- func (p *Parser) Contexts(filters []string) []string
- func (p *Parser) FormatDateTime(input string, relativeTime time.Time) string
- func (p *Parser) ParseAddNote(todo *Todo, mods []string) bool
- func (p *Parser) ParseDateTime(input string, relativeTime time.Time) time.Time
- func (p *Parser) ParseDeleteNote(todo *Todo, mods []string) bool
- func (p *Parser) ParseEditNote(todo *Todo, mods []string) bool
- func (p *Parser) ParseEditTodo(todo *Todo, mods []string, todolist *TodoList) bool
- func (p *Parser) ParseInput(mods []string, todo *Todo, todolist *TodoList)
- func (p *Parser) ParseNewTodo(mods []string, todolist *TodoList) *Todo
- func (p *Parser) Projects(filters []string) []string
- type Printer
- type Report
- type ReportCmd
- type ScreenPrinter
- func (f *ScreenPrinter) PrintAddHelp()
- func (f *ScreenPrinter) PrintAddNoteHelp()
- func (f *ScreenPrinter) PrintArchiveCompletedHelp()
- func (f *ScreenPrinter) PrintArchiveHelp()
- func (f *ScreenPrinter) PrintArgsHelp()
- func (f *ScreenPrinter) PrintCompleteAndArchiveHelp()
- func (f *ScreenPrinter) PrintCompleteHelp()
- func (f *ScreenPrinter) PrintConfigHelp()
- func (f *ScreenPrinter) PrintContextsHelp()
- func (f *ScreenPrinter) PrintDatesHelp()
- func (f *ScreenPrinter) PrintDeleteHelp()
- func (f *ScreenPrinter) PrintDeleteNoteHelp()
- func (f *ScreenPrinter) PrintDoneHelp()
- func (f *ScreenPrinter) PrintEditHelp()
- func (f *ScreenPrinter) PrintEditNoteHelp()
- func (f *ScreenPrinter) PrintExportHelp()
- func (f *ScreenPrinter) PrintFiltersHelp()
- func (f *ScreenPrinter) PrintGarbageCollectHelp()
- func (f *ScreenPrinter) PrintImportHelp()
- func (f *ScreenPrinter) PrintInitHelp()
- func (f *ScreenPrinter) PrintListHelp()
- func (f *ScreenPrinter) PrintModifiersHelp()
- func (f *ScreenPrinter) PrintOpenHelp()
- func (f *ScreenPrinter) PrintOrderTodosHelp()
- func (f *ScreenPrinter) PrintOverallHelp()
- func (f *ScreenPrinter) PrintPrintTodoDetailHelp()
- func (f *ScreenPrinter) PrintProjectsHelp()
- func (f *ScreenPrinter) PrintReport(report *Report, todos []*Todo)
- func (f *ScreenPrinter) PrintRow(line []string)
- func (f *ScreenPrinter) PrintSetCounts(set string, m map[string]int)
- func (f *ScreenPrinter) PrintStats(filtered []*Todo, groupBy string, sumBy string, cols []string, chart bool, ...)
- func (f *ScreenPrinter) PrintStatsHelp()
- func (f *ScreenPrinter) PrintSyncHelp()
- func (f *ScreenPrinter) PrintTodoDetail(todos []*Todo)
- func (f *ScreenPrinter) PrintTouchHelp()
- func (f *ScreenPrinter) PrintUnarchiveHelp()
- func (f *ScreenPrinter) PrintUncompleteHelp()
- func (f *ScreenPrinter) PrintViewHelp()
- type StatSorter
- type StatsData
- type StatsGroup
- type Store
- type ToDoFilter
- type Todo
- type TodoList
- func (t *TodoList) Add(todo *Todo) int
- func (t *TodoList) AddContext(c string, todo *Todo)
- func (t *TodoList) AddOrdinal(set string, todo *Todo)
- func (t *TodoList) AddProject(p string, todo *Todo)
- func (t *TodoList) Archive(todos ...*Todo)
- func (t *TodoList) Complete(todos ...*Todo)
- func (t *TodoList) CompleteAndArchive(todos ...*Todo)
- func (t *TodoList) Delete(todos ...*Todo)
- func (t *TodoList) Edit(mods []string, todos ...*Todo) bool
- func (t *TodoList) ExpireTodos() bool
- func (t *TodoList) FindById(id int) *Todo
- func (t *TodoList) GarbageCollect()
- func (t *TodoList) IndexOf(todoToFind *Todo) int
- func (t *TodoList) Load(todos []*Todo)
- func (t *TodoList) MaxId() int
- func (t *TodoList) NextId() int
- func (t *TodoList) ReassignAllIds() []*Todo
- func (t *TodoList) RemoveContext(c string, todo *Todo)
- func (t *TodoList) RemoveOrdinal(set string, todo *Todo)
- func (t *TodoList) RemoveProject(p string, todo *Todo)
- func (t *TodoList) Todos() []*Todo
- func (t *TodoList) Touch(todos ...*Todo) bool
- func (t *TodoList) Unarchive(todos ...*Todo)
- func (t *TodoList) Uncomplete(todos ...*Todo)
- func (t *TodoList) UpdateOrdinals(set string, ids []int)
- type TodoSorter
- type TodoStat
- type TodoSync
- type Webapp
Constants ¶
const ( VERSION = "0.6" S3URL = "https://s3.amazonaws.com/todolist-local/" + VERSION )
Variables ¶
var Now time.Time
Current time reference used in execution of any single todo invocation for parsing, date filtering, sorting, etc.
var (
Priority map[string]int
)
Declare Priority global because need access in filter and sorter
Functions ¶
func AddIfNotThere ¶
func CreateDefaultConfig ¶
func CreateDefaultConfig() error
func ExecOrder ¶
func ExecOrder(asc bool) lessFunc
execution order = priority / (days til due / days of effort)
func GetTodos ¶
func GetTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func IndexScaffold ¶
func IndexScaffold(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func OrdinalAll ¶
func OrdinalAll(asc bool) lessFunc
func OrdinalContext ¶
func OrdinalContext(asc bool) lessFunc
func OrdinalProject ¶
func OrdinalProject(asc bool) lessFunc
func PrioritySorter ¶
func PrioritySorter(asc bool) lessFunc
func RedirectScaffold ¶
func RedirectScaffold(w http.ResponseWriter, r *http.Request)
func RedirectToIndex ¶
func RedirectToIndex(w http.ResponseWriter, r *http.Request)
func SaveTodos ¶
func SaveTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func TodoOptions ¶
func TodoOptions(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Types ¶
type App ¶
type App struct { TodoStore Store Cfg *Config Printer Printer TodoList *TodoList CommandMap map[string]Command }
func (*App) AddAliasCommand ¶
func (*App) AddDoneTodo ¶
func (a *App) AddDoneTodo(c *CommandImpl)
AddDoneTodo Adds a todo and immediately completed it.
func (*App) AddNote ¶
func (a *App) AddNote(c *CommandImpl)
func (*App) AddTodo ¶
func (a *App) AddTodo(c *CommandImpl)
func (*App) ArchiveCompleted ¶
func (a *App) ArchiveCompleted(c *CommandImpl)
func (*App) ArchiveTodo ¶
func (a *App) ArchiveTodo(c *CommandImpl)
func (*App) CompleteAndArchive ¶
func (a *App) CompleteAndArchive(c *CommandImpl)
func (*App) CompleteTodo ¶
func (a *App) CompleteTodo(c *CommandImpl)
func (*App) DeleteNote ¶
func (a *App) DeleteNote(c *CommandImpl)
func (*App) DeleteTodo ¶
func (a *App) DeleteTodo(c *CommandImpl)
func (*App) EditNote ¶
func (a *App) EditNote(c *CommandImpl)
func (*App) EditTodo ¶
func (a *App) EditTodo(c *CommandImpl)
func (*App) EncodeUri ¶
This only works for web urls Still have a challenge with Windows files and paths with spaces Not using in openUri function above.
func (*App) ExecAlias ¶
func (a *App) ExecAlias(c *CommandImpl)
func (*App) ExportTodo ¶
func (a *App) ExportTodo(c *CommandImpl)
func (*App) GarbageCollect ¶
func (a *App) GarbageCollect(c *CommandImpl)
func (*App) ImportTodo ¶
func (a *App) ImportTodo(c *CommandImpl)
func (*App) InitializeRepo ¶
func (a *App) InitializeRepo(c *CommandImpl)
func (*App) ListContexts ¶
func (a *App) ListContexts(c *CommandImpl)
func (*App) ListProjects ¶
func (a *App) ListProjects(c *CommandImpl)
func (*App) LoadArchived ¶
func (*App) LoadPending ¶
func (*App) NewWebApp ¶
func (a *App) NewWebApp(c *CommandImpl)
func (*App) Open ¶
func (a *App) Open(c *CommandImpl)
func (*App) OrderTodos ¶
func (a *App) OrderTodos(c *CommandImpl)
func (*App) PrintHelp ¶
func (a *App) PrintHelp(c *CommandImpl)
func (*App) PrintTodoDetail ¶
func (a *App) PrintTodoDetail(c *CommandImpl)
func (*App) ProcessCmdLine ¶
func (*App) SetView ¶
func (a *App) SetView(c *CommandImpl)
func (*App) Stats ¶
func (a *App) Stats(c *CommandImpl)
func (*App) Sync ¶
func (a *App) Sync(c *CommandImpl)
func (*App) TouchTodo ¶
func (a *App) TouchTodo(c *CommandImpl)
func (*App) UnarchiveTodo ¶
func (a *App) UnarchiveTodo(c *CommandImpl)
func (*App) UncompleteTodo ¶
func (a *App) UncompleteTodo(c *CommandImpl)
type Command ¶
type Command interface { Exec(a *App) GetCmd() string SetCmd(cmd string) GetFilters() []string SetFilters(filters []string) GetMods() []string SetMods(mods []string) GetArgs() []string SetArgs(args []string) AcceptsMods() bool SetAcceptsMods(acceptsMods bool) AcceptsArgs() bool SetAcceptsArgs(acceptsArgs bool) }
type CommandImpl ¶
type CommandImpl struct { Cmd string Filters []string Mods []string Args []string IsAcceptMods bool IsAcceptArgs bool ExecFunc func(c *CommandImpl) }
func NewCommand ¶
func NewCommand(cmd string, iam bool, iaa bool, ef func(c *CommandImpl)) *CommandImpl
func (*CommandImpl) AcceptsArgs ¶
func (c *CommandImpl) AcceptsArgs() bool
func (*CommandImpl) AcceptsMods ¶
func (c *CommandImpl) AcceptsMods() bool
func (*CommandImpl) Exec ¶
func (c *CommandImpl) Exec(a *App)
func (*CommandImpl) GetArgs ¶
func (c *CommandImpl) GetArgs() []string
func (*CommandImpl) GetCmd ¶
func (c *CommandImpl) GetCmd() string
func (*CommandImpl) GetFilters ¶
func (c *CommandImpl) GetFilters() []string
func (*CommandImpl) GetMods ¶
func (c *CommandImpl) GetMods() []string
func (*CommandImpl) SetAcceptsArgs ¶
func (c *CommandImpl) SetAcceptsArgs(acceptsArgs bool)
func (*CommandImpl) SetAcceptsMods ¶
func (c *CommandImpl) SetAcceptsMods(acceptsMods bool)
func (*CommandImpl) SetArgs ¶
func (c *CommandImpl) SetArgs(args []string)
func (*CommandImpl) SetCmd ¶
func (c *CommandImpl) SetCmd(cmd string)
func (*CommandImpl) SetFilters ¶
func (c *CommandImpl) SetFilters(filters []string)
func (*CommandImpl) SetMods ¶
func (c *CommandImpl) SetMods(mods []string)
type Config ¶
type Config struct { Aliases map[string]string Reports map[string]map[string]string Views map[string][]string CurrentView string SyncFilepath string SyncEncryptionPassphrase string OpenNotesFolder string OpenNotesExt string OpenNotesRegex string OpenNotesCmd string OpenCustomRegex map[string]string OpenCustomCmd map[string]string }
type ConfigStore ¶
func NewConfigStore ¶
func NewConfigStore() *ConfigStore
func (*ConfigStore) Load ¶
func (f *ConfigStore) Load() (*Config, error)
func (*ConfigStore) SetConfigValue ¶
func (f *ConfigStore) SetConfigValue(attr string, attrValue string) error
type DateFilter ¶
func NewDateFilter ¶
func NewDateFilter(todos []*Todo) *DateFilter
func (*DateFilter) FilterDateRange ¶
func (*DateFilter) FilterDoneDate ¶
func (f *DateFilter) FilterDoneDate(filters []string) ([]*Todo, []string)
func (*DateFilter) FilterDueDate ¶
func (f *DateFilter) FilterDueDate(filters []string) ([]*Todo, []string)
func (*DateFilter) FilterExcludeWaiting ¶
func (f *DateFilter) FilterExcludeWaiting() []*Todo
func (*DateFilter) FilterExpired ¶
func (f *DateFilter) FilterExpired() []*Todo
func (*DateFilter) FilterIncludeWaiting ¶
func (f *DateFilter) FilterIncludeWaiting() []*Todo
func (*DateFilter) FilterModDate ¶
func (f *DateFilter) FilterModDate(filters []string) ([]*Todo, []string)
func (*DateFilter) FilterWaiting ¶
func (f *DateFilter) FilterWaiting(filters []string) ([]*Todo, []string)
type FileStore ¶
type FileStore struct { PendingFileLocation string ArchivedFileLocation string BacklogFileLocation string PendingLoaded bool ArchivedLoaded bool }
func NewFileStore ¶
func NewFileStore() *FileStore
func (*FileStore) AppendBacklog ¶
func (*FileStore) DeleteBacklog ¶
func (*FileStore) GetBacklogFilepath ¶
func (*FileStore) Initialize ¶
func (f *FileStore) Initialize()
func (*FileStore) LoadArchived ¶
func (*FileStore) LoadPending ¶
type Parser ¶
type Parser struct{}
func (*Parser) FormatDateTime ¶
func (*Parser) ParseDateTime ¶
func (*Parser) ParseEditTodo ¶
func (*Parser) ParseInput ¶
func (*Parser) ParseNewTodo ¶
type Report ¶
type ReportCmd ¶
type ReportCmd struct { CommandImpl SavedReport *Report }
type ScreenPrinter ¶
func NewScreenPrinter ¶
func NewScreenPrinter() *ScreenPrinter
func (*ScreenPrinter) PrintAddHelp ¶
func (f *ScreenPrinter) PrintAddHelp()
func (*ScreenPrinter) PrintAddNoteHelp ¶
func (f *ScreenPrinter) PrintAddNoteHelp()
func (*ScreenPrinter) PrintArchiveCompletedHelp ¶
func (f *ScreenPrinter) PrintArchiveCompletedHelp()
func (*ScreenPrinter) PrintArchiveHelp ¶
func (f *ScreenPrinter) PrintArchiveHelp()
func (*ScreenPrinter) PrintArgsHelp ¶
func (f *ScreenPrinter) PrintArgsHelp()
func (*ScreenPrinter) PrintCompleteAndArchiveHelp ¶
func (f *ScreenPrinter) PrintCompleteAndArchiveHelp()
func (*ScreenPrinter) PrintCompleteHelp ¶
func (f *ScreenPrinter) PrintCompleteHelp()
func (*ScreenPrinter) PrintConfigHelp ¶
func (f *ScreenPrinter) PrintConfigHelp()
func (*ScreenPrinter) PrintContextsHelp ¶
func (f *ScreenPrinter) PrintContextsHelp()
func (*ScreenPrinter) PrintDatesHelp ¶
func (f *ScreenPrinter) PrintDatesHelp()
func (*ScreenPrinter) PrintDeleteHelp ¶
func (f *ScreenPrinter) PrintDeleteHelp()
func (*ScreenPrinter) PrintDeleteNoteHelp ¶
func (f *ScreenPrinter) PrintDeleteNoteHelp()
func (*ScreenPrinter) PrintDoneHelp ¶
func (f *ScreenPrinter) PrintDoneHelp()
func (*ScreenPrinter) PrintEditHelp ¶
func (f *ScreenPrinter) PrintEditHelp()
func (*ScreenPrinter) PrintEditNoteHelp ¶
func (f *ScreenPrinter) PrintEditNoteHelp()
func (*ScreenPrinter) PrintExportHelp ¶
func (f *ScreenPrinter) PrintExportHelp()
func (*ScreenPrinter) PrintFiltersHelp ¶
func (f *ScreenPrinter) PrintFiltersHelp()
func (*ScreenPrinter) PrintGarbageCollectHelp ¶
func (f *ScreenPrinter) PrintGarbageCollectHelp()
func (*ScreenPrinter) PrintImportHelp ¶
func (f *ScreenPrinter) PrintImportHelp()
func (*ScreenPrinter) PrintInitHelp ¶
func (f *ScreenPrinter) PrintInitHelp()
func (*ScreenPrinter) PrintListHelp ¶
func (f *ScreenPrinter) PrintListHelp()
func (*ScreenPrinter) PrintModifiersHelp ¶
func (f *ScreenPrinter) PrintModifiersHelp()
func (*ScreenPrinter) PrintOpenHelp ¶
func (f *ScreenPrinter) PrintOpenHelp()
func (*ScreenPrinter) PrintOrderTodosHelp ¶
func (f *ScreenPrinter) PrintOrderTodosHelp()
func (*ScreenPrinter) PrintOverallHelp ¶
func (f *ScreenPrinter) PrintOverallHelp()
func (*ScreenPrinter) PrintPrintTodoDetailHelp ¶
func (f *ScreenPrinter) PrintPrintTodoDetailHelp()
func (*ScreenPrinter) PrintProjectsHelp ¶
func (f *ScreenPrinter) PrintProjectsHelp()
func (*ScreenPrinter) PrintReport ¶
func (f *ScreenPrinter) PrintReport(report *Report, todos []*Todo)
func (*ScreenPrinter) PrintRow ¶
func (f *ScreenPrinter) PrintRow(line []string)
func (*ScreenPrinter) PrintSetCounts ¶
func (f *ScreenPrinter) PrintSetCounts(set string, m map[string]int)
func (*ScreenPrinter) PrintStats ¶
func (f *ScreenPrinter) PrintStats(filtered []*Todo, groupBy string, sumBy string, cols []string, chart bool, rangeTimes []time.Time)
pending, added, touched, completed, archived per all, project or context filtered by everything we allow to filter
td <filters> stats [by:all|pro|ctx] [cols:p,a,m,c,ar] [sum:all|daily|weekly|monthly] output is tabular. If sum and by:pro/ctx then group stats and row per day/week/month If no sum (or sum:all) then no grouping and row per pro/ctx
func (*ScreenPrinter) PrintStatsHelp ¶
func (f *ScreenPrinter) PrintStatsHelp()
func (*ScreenPrinter) PrintSyncHelp ¶
func (f *ScreenPrinter) PrintSyncHelp()
func (*ScreenPrinter) PrintTodoDetail ¶
func (f *ScreenPrinter) PrintTodoDetail(todos []*Todo)
func (*ScreenPrinter) PrintTouchHelp ¶
func (f *ScreenPrinter) PrintTouchHelp()
func (*ScreenPrinter) PrintUnarchiveHelp ¶
func (f *ScreenPrinter) PrintUnarchiveHelp()
func (*ScreenPrinter) PrintUncompleteHelp ¶
func (f *ScreenPrinter) PrintUncompleteHelp()
func (*ScreenPrinter) PrintViewHelp ¶
func (f *ScreenPrinter) PrintViewHelp()
type StatSorter ¶
type StatSorter struct {
// contains filtered or unexported fields
}
func (*StatSorter) Less ¶
func (ss *StatSorter) Less(i, j int) bool
func (*StatSorter) Sort ¶
func (ss *StatSorter) Sort(stats []*TodoStat)
Sort sorts the argument slice according to the less functions passed to OrderedBy.
type StatsData ¶
type StatsData struct {
Groups map[string]*StatsGroup
}
func (*StatsData) CalcStatsForTodoAndGroup ¶
func (*StatsData) GetSortedGroups ¶
func (s *StatsData) GetSortedGroups() []*StatsGroup
func (*StatsData) SortedGroup ¶
func (s *StatsData) SortedGroup(group string) *StatsGroup
type StatsGroup ¶
type Store ¶
type Store interface { Initialize() LoadPending() ([]*Todo, error) LoadArchived() ([]*Todo, error) LoadBacklog(filepath string) ([]*Todo, error) GetBacklogFilepath() string AppendBacklog(filepath string, todos []*Todo) DeleteBacklog(filepath string) Save(todos []*Todo) Import(filepath string) ([]*Todo, error) Export(filepath string, todos []*Todo) }
type ToDoFilter ¶
type ToDoFilter struct {
Todos []*Todo
}
func NewToDoFilter ¶
func NewToDoFilter(todos []*Todo) *ToDoFilter
func (*ToDoFilter) Filter ¶
func (f *ToDoFilter) Filter(filters []string) []*Todo
func (*ToDoFilter) FilterEffort ¶
func (f *ToDoFilter) FilterEffort(filters []string) ([]*Todo, []string)
type Todo ¶
type Todo struct { Id int `json:"id"` Uuid string `json:"uuid"` Subject string `json:"subject"` Projects []string `json:"projects"` Contexts []string `json:"contexts"` Priority string `json:"priority"` Ordinals map[string]int `json:"ordinals"` CreatedDate string `json:"createdDate"` ModifiedDate string `json:"modifiedDate"` IsModified bool `json:"-"` Wait string `json:"wait"` Until string `json:"until"` Due string `json:"due"` EffortDays float64 `json:"effortDays"` Completed bool `json:"completed"` CompletedDate string `json:"completedDate"` Status string `json:"status"` Notes []string `json:"notes"` ExecOrder float64 }
func AddTodoIfNotThere ¶
func (Todo) HasContext ¶
func (Todo) HasProject ¶
func (*Todo) Uncomplete ¶
func (t *Todo) Uncomplete()
type TodoList ¶
type TodoList struct {
Data []*Todo
}
func (*TodoList) AddContext ¶
func (*TodoList) AddOrdinal ¶
func (*TodoList) AddProject ¶
func (*TodoList) CompleteAndArchive ¶
func (*TodoList) ExpireTodos ¶
func (*TodoList) GarbageCollect ¶
func (t *TodoList) GarbageCollect()
func (*TodoList) ReassignAllIds ¶
func (*TodoList) RemoveContext ¶
func (*TodoList) RemoveOrdinal ¶
func (*TodoList) RemoveProject ¶
func (*TodoList) Uncomplete ¶
func (*TodoList) UpdateOrdinals ¶
type TodoSorter ¶
type TodoSorter struct { SortColumns []string // contains filtered or unexported fields }
multiSorter implements the Sort interface, sorting the changes within.
func NewTodoSorter ¶
func NewTodoSorter(sortCols ...string) *TodoSorter
func (*TodoSorter) Less ¶
func (s *TodoSorter) Less(i, j int) bool
Less is part of sort.Interface. It is implemented by looping along the less functions until it finds a comparison that is either Less or !Less. Note that it can call the less functions twice per call. We could change the functions to return -1, 0, 1 and reduce the number of calls for greater efficiency: an exercise for the reader.
func (*TodoSorter) Sort ¶
func (s *TodoSorter) Sort(todos []*Todo)
Sort sorts the argument slice according to the less functions passed to OrderedBy.
type TodoSync ¶
type TodoSync struct { Checkpoint *Todo Backlog *TodoList Remote *TodoList Local *TodoList // contains filtered or unexported fields }