todo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat     = "2006-01-02"
	DateTimeFormat = "2006-01-02 15:04:05"
	DateFormat     = "2006-01-02"
	CompletedChar  = "✅ "
	OpenedChar     = ""
	PendingChar    = "⌛"
	ClockChar      = "⏱"
)

Variables

This section is empty.

Functions

func NewItemId

func NewItemId() string

func SortList

func SortList(list []*ToDoItem)

Types

type ToDoCollection

type ToDoCollection struct {
	Items        map[string]*ToDoItem `yaml:"items"`
	DeletedItems []string             `yaml:"deleted_items"`
	LastUpdate   time.Time            `yaml:"last_update"`
	LastSave     time.Time            `yaml:"last_save"`
	LastSync     time.Time            `yaml:"last_sync"`
}

func LoadCollection

func LoadCollection(filename string) (collection ToDoCollection, err error)

func LoadCollectionFromData

func LoadCollectionFromData(data []byte) (collection ToDoCollection, err error)

func NewTodoCollection

func NewTodoCollection() *ToDoCollection

func (*ToDoCollection) Add

func (collection *ToDoCollection) Add(item *ToDoItem)

func (*ToDoCollection) Complete

func (collection *ToDoCollection) Complete(index int, undo bool) error

func (*ToDoCollection) DoAct

func (collection *ToDoCollection) DoAct(index int) error

func (*ToDoCollection) Get

func (collection *ToDoCollection) Get(index int) *ToDoItem

func (*ToDoCollection) GetByFilter

func (collection *ToDoCollection) GetByFilter(tags []string, justCompleted bool, justPending bool) []*ToDoItem

func (*ToDoCollection) GetChildren

func (collection *ToDoCollection) GetChildren(id string) []*ToDoItem

func (*ToDoCollection) GetTreeList

func (collection *ToDoCollection) GetTreeList(items []*ToDoItem) []string

func (*ToDoCollection) GistSync

func (c *ToDoCollection) GistSync(config *github.GistConfig) (diffCount int, log []string, err error)

func (*ToDoCollection) Merge

func (collection *ToDoCollection) Merge(other *ToDoCollection) (log []string, diffCount int, upload bool)

func (*ToDoCollection) Remove

func (collection *ToDoCollection) Remove(index int) error

func (*ToDoCollection) Save

func (c *ToDoCollection) Save(filename string) (err error)

func (*ToDoCollection) Sorted

func (collection *ToDoCollection) Sorted() (items []*ToDoItem)

func (*ToDoCollection) UpdateLevels

func (c *ToDoCollection) UpdateLevels()

type ToDoItem

type ToDoItem struct {
	Id         string    `yaml:"id"`
	Index      int       `yaml:"index"`
	Title      string    `yaml:"title"`
	Completed  bool      `yaml:"completed"`
	DueTo      time.Time `yaml:"due_to"`
	LastAction time.Time `yaml:"last_action"`
	Tags       []string  `yaml:"tags"`
	UpdatedAt  time.Time `yaml:"updated_at"`
	ParentId   string    `yaml:"parent_id"`
	Deleted    bool      `yaml:"-"`
	Level      int       `yaml:"level"`
}

func MergeCollections

func MergeCollections(col1 []*ToDoItem, col2 []*ToDoItem) (newCol []*ToDoItem, deleted_items []string, log []string, diffCount int, upload bool)

func (*ToDoItem) ItemColor

func (item *ToDoItem) ItemColor() func(string) string

func (*ToDoItem) LevelString

func (item *ToDoItem) LevelString(level int) string

func (*ToDoItem) NotifyText

func (item *ToDoItem) NotifyText() string

func (*ToDoItem) String

func (item *ToDoItem) String() string

func (*ToDoItem) StringNoColor

func (item *ToDoItem) StringNoColor() string

Jump to

Keyboard shortcuts

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