todolist

package
v0.0.0-...-7ea9824 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION = "0.6"
	S3URL   = "https://s3.amazonaws.com/todolist-local/" + VERSION
)

Variables

Current time reference used in execution of any single todo invocation for parsing, date filtering, sorting, etc.

View Source
var (
	Priority map[string]int
)

Declare Priority global because need access in filter and sorter

Functions

func AddIfNotThere

func AddIfNotThere(arr []string, items []string) []string

func Age

func Age(asc bool) lessFunc

func Context

func Context(asc bool) lessFunc

func CreateDefaultConfig

func CreateDefaultConfig() error

func Created

func Created(asc bool) lessFunc

func DateSort

func DateSort(asc bool) sortFunc

func Due

func Due(asc bool) lessFunc

func Effort

func Effort(asc bool) lessFunc

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 Id

func Id(asc bool) lessFunc

func IndexScaffold

func IndexScaffold(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func Modified

func Modified(asc bool) lessFunc

func Notes

func Notes(asc bool) lessFunc

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 Project

func Project(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 Subject

func Subject(asc bool) lessFunc

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 NewApp

func NewApp() *App

func (*App) AddAliasCommand

func (a *App) AddAliasCommand(alias string, command string)

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) AddReportCommand

func (a *App) AddReportCommand(key string, val *Report) *ReportCmd

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

func (a *App) EncodeUri(uri string) string

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 (a *App) LoadArchived() error

func (*App) LoadPending

func (a *App) LoadPending() error

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 (a *App) ProcessCmdLine(input string) Command

func (*App) Save

func (a *App) Save()

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 ByDate

type ByDate []*Todo

func (ByDate) Len

func (a ByDate) Len() int

func (ByDate) Less

func (a ByDate) Less(i, j int) bool

func (ByDate) Swap

func (a ByDate) Swap(i, j int)

type ByUuid

type ByUuid []*Todo

func (ByUuid) Len

func (a ByUuid) Len() int

func (ByUuid) Less

func (a ByUuid) Less(i, j int) bool

func (ByUuid) Swap

func (a ByUuid) Swap(i, j int)

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
}

func (*Config) GetAlias

func (c *Config) GetAlias(alias string) (string, bool)

func (*Config) GetReport

func (c *Config) GetReport(report string) (*Report, bool)

type ConfigStore

type ConfigStore struct {
	FileLocation string
	Loaded       bool
}

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

type DateFilter struct {
	Todos  []*Todo
	Now    time.Time
	Parser Parser
}

func NewDateFilter

func NewDateFilter(todos []*Todo) *DateFilter

func (*DateFilter) FilterAge

func (f *DateFilter) FilterAge(filters []string) ([]*Todo, []string)

func (*DateFilter) FilterDateRange

func (f *DateFilter) FilterDateRange(filters []string, regex *regexp.Regexp, dateConvFunc func(*Todo) time.Time) ([]*Todo, []string)

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 (f *FileStore) AppendBacklog(filepath string, todos []*Todo)

func (*FileStore) DeleteBacklog

func (f *FileStore) DeleteBacklog(filepath string)

func (*FileStore) Export

func (f *FileStore) Export(filepath string, todos []*Todo)

func (*FileStore) GetBacklogFilepath

func (f *FileStore) GetBacklogFilepath() string

func (*FileStore) Import

func (f *FileStore) Import(filepath string) ([]*Todo, error)

func (*FileStore) Initialize

func (f *FileStore) Initialize()

func (*FileStore) LoadArchived

func (f *FileStore) LoadArchived() ([]*Todo, error)

func (*FileStore) LoadBacklog

func (f *FileStore) LoadBacklog(filepath string) ([]*Todo, error)

func (*FileStore) LoadPending

func (f *FileStore) LoadPending() ([]*Todo, error)

func (*FileStore) Save

func (f *FileStore) Save(todos []*Todo)

type OpenTask

type OpenTask struct {
	Todo      *Todo
	NoteIndex int
	UriType   string
	Uri       string
	Cmd       string
}

func NewOpenTask

func NewOpenTask(todo *Todo, idx int, uriType string, uri string, cmd string) *OpenTask

type Parser

type Parser struct{}

func (*Parser) Contexts

func (p *Parser) Contexts(filters []string) []string

func (*Parser) FormatDateTime

func (p *Parser) FormatDateTime(input string, relativeTime time.Time) string

func (*Parser) ParseAddNote

func (p *Parser) ParseAddNote(todo *Todo, mods []string) bool

func (*Parser) ParseDateTime

func (p *Parser) ParseDateTime(input string, relativeTime time.Time) time.Time

func (*Parser) ParseDeleteNote

func (p *Parser) ParseDeleteNote(todo *Todo, mods []string) bool

func (*Parser) ParseEditNote

func (p *Parser) ParseEditNote(todo *Todo, mods []string) bool

func (*Parser) ParseEditTodo

func (p *Parser) ParseEditTodo(todo *Todo, mods []string, todolist *TodoList) bool

func (*Parser) ParseInput

func (p *Parser) ParseInput(mods []string, todo *Todo, todolist *TodoList)

func (*Parser) ParseNewTodo

func (p *Parser) ParseNewTodo(mods []string, todolist *TodoList) *Todo

func (*Parser) Projects

func (p *Parser) Projects(filters []string) []string

type Printer

type Printer interface {
	//Print(*GroupedTodos, bool)
	PrintReport(*Report, []*Todo)
}

type Report

type Report struct {
	Description string
	Filters     []string
	Columns     []string
	Headers     []string
	Sorter      *TodoSorter
	Group       string
	PrintNotes  bool
}

func (*Report) Init

func (r *Report) Init(rc map[string]string)

type ReportCmd

type ReportCmd struct {
	CommandImpl
	SavedReport *Report
}

func (*ReportCmd) Exec

func (c *ReportCmd) Exec(a *App)

type ScreenPrinter

type ScreenPrinter struct {
	Writer *tabwriter.Writer
	// contains filtered or unexported fields
}

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) Len

func (ss *StatSorter) Len() int

Len is part of sort.Interface.

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.

func (*StatSorter) Swap

func (ss *StatSorter) Swap(i, j int)

Swap is part of sort.Interface.

type StatsData

type StatsData struct {
	Groups map[string]*StatsGroup
}

func (*StatsData) CalcStats

func (s *StatsData) CalcStats(todos []*Todo, groupBy string, sum int, rangeTimes []time.Time)

func (*StatsData) CalcStatsForTodoAndGroup

func (s *StatsData) CalcStatsForTodoAndGroup(todo *Todo, group string, sumBy int)

func (*StatsData) GetSortedGroups

func (s *StatsData) GetSortedGroups() []*StatsGroup

func (*StatsData) SortedGroup

func (s *StatsData) SortedGroup(group string) *StatsGroup

type StatsGroup

type StatsGroup struct {
	Group    string
	PrevStat *TodoStat //Use to track pending todos across dates
	Stats    []*TodoStat
}

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 AddTodoIfNotThere(arr []*Todo, item *Todo) []*Todo

func NewTodo

func NewTodo() *Todo

func (*Todo) Archive

func (t *Todo) Archive()

func (*Todo) Complete

func (t *Todo) Complete()

func (Todo) HasContext

func (t Todo) HasContext(ctx string) bool

func (Todo) HasProject

func (t Todo) HasProject(proj string) bool

func (*Todo) Unarchive

func (t *Todo) Unarchive()

func (*Todo) Uncomplete

func (t *Todo) Uncomplete()

func (Todo) Valid

func (t Todo) Valid() bool

type TodoList

type TodoList struct {
	Data []*Todo
}

func (*TodoList) Add

func (t *TodoList) Add(todo *Todo) int

func (*TodoList) AddContext

func (t *TodoList) AddContext(c string, todo *Todo)

func (*TodoList) AddOrdinal

func (t *TodoList) AddOrdinal(set string, todo *Todo)

func (*TodoList) AddProject

func (t *TodoList) AddProject(p string, todo *Todo)

func (*TodoList) Archive

func (t *TodoList) Archive(todos ...*Todo)

func (*TodoList) Complete

func (t *TodoList) Complete(todos ...*Todo)

func (*TodoList) CompleteAndArchive

func (t *TodoList) CompleteAndArchive(todos ...*Todo)

func (*TodoList) Delete

func (t *TodoList) Delete(todos ...*Todo)

func (*TodoList) Edit

func (t *TodoList) Edit(mods []string, todos ...*Todo) bool

func (*TodoList) ExpireTodos

func (t *TodoList) ExpireTodos() bool

func (*TodoList) FindById

func (t *TodoList) FindById(id int) *Todo

func (*TodoList) GarbageCollect

func (t *TodoList) GarbageCollect()

func (*TodoList) IndexOf

func (t *TodoList) IndexOf(todoToFind *Todo) int

func (*TodoList) Load

func (t *TodoList) Load(todos []*Todo)

func (*TodoList) MaxId

func (t *TodoList) MaxId() int

func (*TodoList) NextId

func (t *TodoList) NextId() int

func (*TodoList) ReassignAllIds

func (t *TodoList) ReassignAllIds() []*Todo

func (*TodoList) RemoveContext

func (t *TodoList) RemoveContext(c string, todo *Todo)

func (*TodoList) RemoveOrdinal

func (t *TodoList) RemoveOrdinal(set string, todo *Todo)

func (*TodoList) RemoveProject

func (t *TodoList) RemoveProject(p string, todo *Todo)

func (*TodoList) Todos

func (t *TodoList) Todos() []*Todo

func (*TodoList) Touch

func (t *TodoList) Touch(todos ...*Todo) bool

func (*TodoList) Unarchive

func (t *TodoList) Unarchive(todos ...*Todo)

func (*TodoList) Uncomplete

func (t *TodoList) Uncomplete(todos ...*Todo)

func (*TodoList) UpdateOrdinals

func (t *TodoList) UpdateOrdinals(set string, ids []int)

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) Len

func (s *TodoSorter) Len() int

Len is part of sort.Interface.

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.

func (*TodoSorter) Swap

func (s *TodoSorter) Swap(i, j int)

Swap is part of sort.Interface.

type TodoStat

type TodoStat struct {
	PeriodStartDate time.Time
	Pending         int
	Unpending       int
	Added           int
	Modified        int
	Completed       int
	Archived        int
}

type TodoSync

type TodoSync struct {
	Checkpoint *Todo
	Backlog    *TodoList
	Remote     *TodoList
	Local      *TodoList
	// contains filtered or unexported fields
}

func NewTodoSync

func NewTodoSync(cfg *Config, s Store) *TodoSync

func (*TodoSync) RemovePriorCheckpointFromSyncFile

func (s *TodoSync) RemovePriorCheckpointFromSyncFile(syncFilepath string)

func (*TodoSync) Run

func (s *TodoSync) Run(script string) bool

* TODO - Expand the following logic

Exec any external script to pull from remote site to local "remote" file Do the sync Exec any external script to push local "remote" file to remote location

func (*TodoSync) Sync

func (s *TodoSync) Sync(verbose bool) error

type Webapp

type Webapp struct {
	Router *httprouter.Router
}

func NewWebapp

func NewWebapp() *Webapp

func (*Webapp) Run

func (w *Webapp) Run()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL