Documentation ¶
Index ¶
- Constants
- func AddIfNotThere(arr []string, items []string) []string
- func FilesHandle(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func GetNotes(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func GetTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func SaveTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func TodoOptions(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type App
- func (a *App) AddDoneTodo(input string)
- func (a *App) AddJournal(input string)
- func (a *App) AddPromise(input string)
- func (a *App) AddTodo(input string)
- func (a *App) ArchiveCompleted()
- func (a *App) ArchiveTodo(input string)
- func (a *App) CompleteTodo(input string)
- func (a *App) DeleteTodo(input string)
- func (a *App) EditTodo(input string)
- func (a *App) ExpandTodo(input string)
- func (a *App) ExpireCountDown()
- func (a *App) GarbageCollect()
- func (a *App) HandleNotes(input string)
- func (a *App) InitializeRepo()
- func (a *App) ListTodos(input string)
- func (a *App) Load() error
- func (a *App) PrioritizeTodo(input string)
- func (a *App) Save()
- func (a *App) UnarchiveTodo(input string)
- func (a *App) UncompleteTodo(input string)
- func (a *App) UnprioritizeTodo(input string)
- type ByDate
- type CreateDateSorter
- type DateFilter
- type DefaultNoteHandler
- type DueDateSorter
- type FileStore
- type FormatPrinter
- type GroupedTodos
- type Grouper
- type MemoryPrinter
- type MemoryStore
- type NotFoundHandler
- type NotesHandler
- type Parser
- func (p *Parser) Contexts(input string) []string
- func (p *Parser) Due(input string, day time.Time) string
- func (p *Parser) ExpandProject(input string) string
- func (p *Parser) ParseAddNote(todo *Todo, input string) bool
- func (p *Parser) ParseDeleteNote(todo *Todo, input string) bool
- func (p *Parser) ParseEditNote(todo *Todo, input string) bool
- func (p *Parser) ParseEditTodo(todo *Todo, input string) bool
- func (p *Parser) ParseLinkNote(todo *Todo, input string) bool
- func (p *Parser) ParseNewTodo(input string) *Todo
- func (p *Parser) ParseShowNote(todo *Todo, input string) bool
- func (p *Parser) Projects(input string) []string
- func (p *Parser) Subject(input string) string
- type Printer
- type ScreenPrinter
- type Store
- type Todo
- func (t *Todo) Archive()
- func (t Todo) CalculateCreateDate() time.Time
- func (t Todo) CalculateDueTime() time.Time
- func (t *Todo) Complete()
- func (t Todo) CompletedDateToDate() string
- func (t *Todo) ExpireCountDown()
- func (t *Todo) Expired() bool
- func (t *Todo) GetType() TodoType
- func (t *Todo) Prioritize()
- func (t *Todo) Unarchive()
- func (t *Todo) Uncomplete()
- func (t *Todo) Unprioritize()
- func (t Todo) Valid() bool
- type TodoFilter
- type TodoList
- func (t *TodoList) Add(todo *Todo)
- func (t *TodoList) Archive(ids ...int)
- func (t *TodoList) Complete(ids ...int)
- func (t *TodoList) Delete(ids ...int)
- 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) Prioritize(ids ...int)
- func (t *TodoList) Todos() []*Todo
- func (t *TodoList) Unarchive(ids ...int)
- func (t *TodoList) Uncomplete(ids ...int)
- func (t *TodoList) Unprioritize(ids ...int)
- type TodoType
- type Webapp
Constants ¶
const ( // signifies that a todo is a traditional todo TodoTypes TodoType = "todo" // signifies that a todo is actually just a journal entry JournalType = "journal" // signifies that a todo is a promise PromiseType = "promise" // used for filters to search on all types AllType = "all" )
const ISO8601_TIMESTAMP_FORMAT = "2006-01-02T15:04:05Z07:00"
Timestamp format to include date, time with timezone support. Easy to parse
Variables ¶
This section is empty.
Functions ¶
func AddIfNotThere ¶
func FilesHandle ¶ added in v1.0.0
func FilesHandle(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func GetNotes ¶ added in v1.1.0
func GetNotes(w http.ResponseWriter, r *http.Request, params httprouter.Params)
Gets all notes for a particular todo ID
func GetTodos ¶
func GetTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
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 ¶
func (*App) AddDoneTodo ¶
AddDoneTodo Adds a todo and immediately completed it.
func (*App) AddJournal ¶ added in v1.0.0
AddDoneTodo Adds a todo and immediately completed it.
func (*App) AddPromise ¶ added in v1.0.0
func (*App) ArchiveCompleted ¶
func (a *App) ArchiveCompleted()
func (*App) ArchiveTodo ¶
func (*App) CompleteTodo ¶
func (*App) DeleteTodo ¶
func (*App) ExpandTodo ¶
func (*App) ExpireCountDown ¶ added in v1.0.0
func (a *App) ExpireCountDown()
func (*App) GarbageCollect ¶
func (a *App) GarbageCollect()
func (*App) HandleNotes ¶
func (*App) InitializeRepo ¶
func (a *App) InitializeRepo()
func (*App) PrioritizeTodo ¶
func (*App) UnarchiveTodo ¶
func (*App) UncompleteTodo ¶
func (*App) UnprioritizeTodo ¶
type CreateDateSorter ¶ added in v1.0.0
type CreateDateSorter struct {
Todos []*Todo
}
func (*CreateDateSorter) Len ¶ added in v1.0.0
func (j *CreateDateSorter) Len() int
Len is the number of elements in the collection.
func (*CreateDateSorter) Less ¶ added in v1.0.0
func (j *CreateDateSorter) Less(a int, b int) bool
Less reports whether the element with index a should sort before the element with index b.
func (*CreateDateSorter) Swap ¶ added in v1.0.0
func (j *CreateDateSorter) Swap(a int, b int)
Swap swaps the elements with indexes a and b.
type DateFilter ¶
func NewDateFilter ¶
func NewDateFilter(todos []*Todo) *DateFilter
func (*DateFilter) FilterDate ¶
func (f *DateFilter) FilterDate(input string) []*Todo
func (*DateFilter) FindSunday ¶
func (f *DateFilter) FindSunday(pivot time.Time) time.Time
type DefaultNoteHandler ¶ added in v1.0.0
type DefaultNoteHandler struct {
// contains filtered or unexported fields
}
Uses the simple make-note command that I wrote
type DueDateSorter ¶ added in v1.0.0
type DueDateSorter struct {
Todos []*Todo
}
func (*DueDateSorter) Len ¶ added in v1.0.0
func (j *DueDateSorter) Len() int
Len is the number of elements in the collection.
func (*DueDateSorter) Less ¶ added in v1.0.0
func (j *DueDateSorter) Less(a int, b int) bool
Less reports whether the element with index a should sort before the element with index b.
func (*DueDateSorter) Swap ¶ added in v1.0.0
func (j *DueDateSorter) Swap(a int, b int)
Swap swaps the elements with indexes a and b.
type FileStore ¶
func NewFileStore ¶
func NewFileStore() *FileStore
func (*FileStore) Initialize ¶
func (f *FileStore) Initialize()
type FormatPrinter ¶ added in v1.1.0
func NewFormatPrinter ¶ added in v1.1.0
func NewFormatPrinter(format string, writer io.Writer) *FormatPrinter
func (*FormatPrinter) Print ¶ added in v1.1.0
func (f *FormatPrinter) Print(groupedTodos *GroupedTodos, printNotes bool)
type GroupedTodos ¶
type Grouper ¶
type Grouper struct{}
func (*Grouper) GroupByContext ¶
func (g *Grouper) GroupByContext(todos []*Todo) *GroupedTodos
func (*Grouper) GroupByNothing ¶
func (g *Grouper) GroupByNothing(todos []*Todo) *GroupedTodos
func (*Grouper) GroupByProject ¶
func (g *Grouper) GroupByProject(todos []*Todo) *GroupedTodos
type MemoryPrinter ¶
type MemoryPrinter struct {
Groups *GroupedTodos
}
func (*MemoryPrinter) Print ¶
func (m *MemoryPrinter) Print(groupedTodos *GroupedTodos, printNotes bool)
type MemoryStore ¶
type MemoryStore struct {
Todos []*Todo
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Initialize ¶
func (m *MemoryStore) Initialize()
func (*MemoryStore) Load ¶
func (m *MemoryStore) Load() ([]*Todo, error)
func (*MemoryStore) Save ¶
func (m *MemoryStore) Save(todos []*Todo)
type NotFoundHandler ¶ added in v1.0.0
type NotFoundHandler struct{}
func (*NotFoundHandler) ServeHTTP ¶ added in v1.0.0
func (nf *NotFoundHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type NotesHandler ¶ added in v1.0.0
type NotesHandler interface {
// contains filtered or unexported methods
}
type Parser ¶
type Parser struct{}
func (*Parser) ExpandProject ¶
func (*Parser) ParseLinkNote ¶ added in v1.0.0
func (*Parser) ParseNewTodo ¶
type Printer ¶
type Printer interface {
Print(todos *GroupedTodos, printNotes bool)
}
type ScreenPrinter ¶
func NewScreenPrinter ¶
func NewScreenPrinter() *ScreenPrinter
func (*ScreenPrinter) Print ¶
func (f *ScreenPrinter) Print(groupedTodos *GroupedTodos, printNotes bool)
type Todo ¶
type Todo struct { Id int `json:"id"` Subject string `json:"subject"` Projects []string `json:"projects"` Contexts []string `json:"contexts"` Due string `json:"due"` Expire int `json:"expire"` Completed bool `json:"completed"` CompletedDate string `json:"completedDate"` ExpiredDate string `json:"expiredDate"` CreateDate string `json:"createDate,omitempty"` Archived bool `json:"archived"` IsPriority bool `json:"isPriority"` Notes []string `json:"notes"` Type string `json:"type,omitempty"` // contains filtered or unexported fields }
func AddTodoIfNotThere ¶
func (Todo) CalculateCreateDate ¶ added in v1.0.0
func (Todo) CalculateDueTime ¶
func (Todo) CompletedDateToDate ¶
func (*Todo) ExpireCountDown ¶ added in v1.0.0
func (t *Todo) ExpireCountDown()
func (*Todo) Prioritize ¶
func (t *Todo) Prioritize()
func (*Todo) Uncomplete ¶
func (t *Todo) Uncomplete()
func (*Todo) Unprioritize ¶
func (t *Todo) Unprioritize()
type TodoFilter ¶
func NewFilter ¶
func NewFilter(todos []*Todo, t TodoType) *TodoFilter
func (*TodoFilter) Filter ¶
func (f *TodoFilter) Filter(input string) []*Todo
func (*TodoFilter) FilterPromise ¶ added in v1.0.0
func (f *TodoFilter) FilterPromise(input string) []*Todo
Always show promises regardless of context or project
type TodoList ¶
type TodoList struct {
Data []*Todo
}
func (*TodoList) GarbageCollect ¶
func (t *TodoList) GarbageCollect()