Documentation ¶
Index ¶
- Constants
- func AddIfNotThere(arr []string, items []string) []string
- func GetTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func IndexScaffold(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- 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 TodoOptions(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type App
- func (a *App) AddDoneTodo(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) 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 DateFilter
- type FileStore
- type GroupedTodos
- type Grouper
- type MemoryPrinter
- type MemoryStore
- 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) 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
- 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 Webapp
Constants ¶
View Source
const ( VERSION = "0.6.1" S3URL = "https://s3.amazonaws.com/todolist-local/" + VERSION )
View Source
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 GetTodos ¶
func GetTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func IndexScaffold ¶
func IndexScaffold(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
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 ¶
func (*App) AddDoneTodo ¶
AddDoneTodo Adds a todo and immediately completed it.
func (*App) ArchiveCompleted ¶
func (a *App) ArchiveCompleted()
func (*App) ArchiveTodo ¶
func (*App) CompleteTodo ¶
func (*App) DeleteTodo ¶
func (*App) ExpandTodo ¶
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 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 FileStore ¶
func NewFileStore ¶
func NewFileStore() *FileStore
func (*FileStore) Initialize ¶
func (f *FileStore) Initialize()
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 Printer ¶
type Printer interface {
Print(*GroupedTodos, bool)
}
type ScreenPrinter ¶
type ScreenPrinter struct {
Writer *tabwriter.Writer
}
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"` Completed bool `json:"completed"` CompletedDate string `json:"completedDate"` Archived bool `json:"archived"` IsPriority bool `json:"isPriority"` Notes []string `json:"notes"` }
func AddTodoIfNotThere ¶
func (Todo) CalculateDueTime ¶
func (Todo) CompletedDateToDate ¶
func (*Todo) Prioritize ¶
func (t *Todo) Prioritize()
func (*Todo) Uncomplete ¶
func (t *Todo) Uncomplete()
func (*Todo) Unprioritize ¶
func (t *Todo) Unprioritize()
type TodoFilter ¶
type TodoFilter struct {
Todos []*Todo
}
func NewFilter ¶
func NewFilter(todos []*Todo) *TodoFilter
func (*TodoFilter) Filter ¶
func (f *TodoFilter) Filter(input string) []*Todo
type TodoList ¶
type TodoList struct {
Data []*Todo
}
func (*TodoList) GarbageCollect ¶
func (t *TodoList) GarbageCollect()
func (*TodoList) Prioritize ¶
func (*TodoList) Uncomplete ¶
func (*TodoList) Unprioritize ¶
Click to show internal directories.
Click to hide internal directories.