Documentation
¶
Index ¶
- Constants
- func NewItemId() string
- func SortList(list []*ToDoItem)
- type ToDoCollection
- func (collection *ToDoCollection) Add(item *ToDoItem)
- func (collection *ToDoCollection) Complete(index int, undo bool) error
- func (collection *ToDoCollection) DoAct(index int) error
- func (collection *ToDoCollection) Get(index int) *ToDoItem
- func (collection *ToDoCollection) GetByFilter(tags []string, justCompleted bool, justPending bool) []*ToDoItem
- func (collection *ToDoCollection) GetChildren(id string) []*ToDoItem
- func (collection *ToDoCollection) GetTreeList(items []*ToDoItem) []string
- func (c *ToDoCollection) GistSync(config *github.GistConfig) (diffCount int, log []string, err error)
- func (collection *ToDoCollection) Merge(other *ToDoCollection) (log []string, diffCount int, upload bool)
- func (collection *ToDoCollection) Remove(index int) error
- func (c *ToDoCollection) Save(filename string) (err error)
- func (collection *ToDoCollection) Sorted() (items []*ToDoItem)
- func (c *ToDoCollection) UpdateLevels()
- type ToDoItem
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 ¶
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 (*ToDoItem) LevelString ¶
func (*ToDoItem) NotifyText ¶
func (*ToDoItem) StringNoColor ¶
Click to show internal directories.
Click to hide internal directories.