Versions in this module Expand all Collapse all v0 v0.4.3 Apr 14, 2024 v0.4.2 Apr 14, 2024 v0.4.1 Mar 13, 2024 v0.4.0 Mar 12, 2024 Changes in this version + var NoNoteIdsError = errors.New(...) + type NotesRepo struct + IdLength int + func NewNotesRepo(notesTag string, notesDir string) *NotesRepo + func (n *NotesRepo) Clean(lists ...*List) error + func (n *NotesRepo) Get(item *Item) (string, error) v0.3.0 Jan 17, 2024 Changes in this version + var DefaultDecoder = Decoder + var DefaultEncoder = Encoder + var DefaultJsonEncoder = JsonEncoder + var ErrAbort = errors.New("operation aborted by hook") + var ErrCompleteBeforeCreation = errors.New("completion date can not be before creation date") + var ErrCompletionDateWhileUndone = errors.New("completion date can not be set on undone task") + var ErrCreationDateUnset = errors.New("completion date can not be set while creation date is not") + var ErrNoPrioWhenDone = errors.New("done tasks must not have a priority") + func MatcherForTag(key string) *regexp.Regexp + type BuildFunc func(*Item) *Item + func CopyOf(item *Item) BuildFunc + func WithCompletionDate(date time.Time) BuildFunc + func WithCreationDate(date time.Time) BuildFunc + func WithDescription(desc string) BuildFunc + func WithDone(done bool) BuildFunc + func WithMeta(done bool, prio Priority, completionDate time.Time, creationDate time.Time) BuildFunc + func WithNowFunc(now func() time.Time) BuildFunc + func WithPriority(prio Priority) BuildFunc + func WithoutCompletionDate() BuildFunc + func WithoutCreationDate() BuildFunc + type Context string + func (c Context) Matcher() *regexp.Regexp + func (c Context) String() string + type Decoder struct + func (d *Decoder) Decode(r io.Reader) ([]*Item, error) + type Encoder struct + func (f Encoder) Encode(w io.Writer, tasks []*Item) error + type Event interface + Dispatch func(*List, Hook) error + type Hook interface + OnMod func(list *List, event ModEvent) error + OnValidate func(list *List, event ValidationEvent) error + type HookFunc func(*List, ModEvent) error + func (h HookFunc) OnMod(list *List, event ModEvent) error + func (h HookFunc) OnValidate(*List, ValidationEvent) error + type Item struct + func BuildItem(modifier ...BuildFunc) (*Item, error) + func MustBuildItem(m ...BuildFunc) *Item + func (i *Item) Apply(item *Item) error + func (i *Item) CleanDescription(projects []Project, contexts []Context, tags []string) string + func (i *Item) Complete() error + func (i *Item) CompletionDate() *time.Time + func (i *Item) Contexts() []Context + func (i *Item) CreationDate() *time.Time + func (i *Item) Description() string + func (i *Item) Done() bool + func (i *Item) EditDescription(desc string) error + func (i *Item) Equals(item *Item) bool + func (i *Item) MarkUndone() error + func (i *Item) PrioritizeAs(prio Priority) error + func (i *Item) Priority() Priority + func (i *Item) Projects() []Project + func (i *Item) SetCreation(creation time.Time) error + func (i *Item) SetTag(key, value string) error + func (i *Item) String() string + func (i *Item) Tags() Tags + type JsonEncoder struct + func (f JsonEncoder) Encode(w io.Writer, list *List, tasks []*Item) error + type List struct + func ListOf(items ...*Item) *List + func (l *List) Add(items ...*Item) (err error) + func (l *List) AddHook(hook Hook) + func (l *List) AllContexts() []Context + func (l *List) AllProjects() []Project + func (l *List) AllTags() []string + func (l *List) GetLine(line int) *Item + func (l *List) Len() int + func (l *List) LineOf(i *Item) int + func (l *List) Remove(line int) error + func (l *List) Reset() + func (l *List) Secret(secretChange func() error) error + func (l *List) Snapshot() + func (l *List) Tasks() []*Item + type ModEvent struct + Current *Item + Previous *Item + func (m ModEvent) Dispatch(list *List, h Hook) error + func (m ModEvent) IsCompleteEvent() bool + type OLockError struct + BackupPath string + func (o OLockError) Error() string + type ParseError struct + func (p ParseError) Error() string + type Priority byte + const PrioA + const PrioB + const PrioC + const PrioD + const PrioE + const PrioF + const PrioG + const PrioH + const PrioI + const PrioJ + const PrioK + const PrioL + const PrioM + const PrioN + const PrioNone + const PrioO + const PrioP + const PrioQ + const PrioR + const PrioS + const PrioT + const PrioU + const PrioV + const PrioW + const PrioX + const PrioY + const PrioZ + func PriorityFromString(prio string) (Priority, error) + func (p Priority) String() string + type Project string + func (p Project) Matcher() *regexp.Regexp + func (p Project) String() string + type ReadError struct + BaseError error + Line string + LineNumber int + func (r ReadError) Error() string + func (r ReadError) Unwrap() error + type ReadFunc func() (*List, error) + type Repo struct + Decoder *Decoder + DefaultHooks []Hook + Encoder *Encoder + Keep int + func NewRepo(dest string) *Repo + func (t *Repo) Close() error + func (t *Repo) Read() (*List, error) + func (t *Repo) Save(l *List) error + func (t *Repo) Watch() (<-chan ReadFunc, func(), error) + type Tags map[string][]string + func (t Tags) Keys() []string + type ValidationError struct + Base error + Line int + OffendingItem *Item + func (v ValidationError) Error() string + func (v ValidationError) Unwrap() error + type ValidationEvent struct + Item *Item + func (v ValidationEvent) Dispatch(list *List, h Hook) error