Documentation ¶
Index ¶
- Constants
- func EqualTags(tags1 []string, tags2 []string) bool
- func NewItemId() string
- func ParseTags(tags []string) []string
- func SortList(list []*Item)
- type Collection
- func (collection *Collection) Add(item *Item)
- func (c *Collection) Backup(cfg *config.BackupConfig) (err error)
- func (c *Collection) BackupPrefix() string
- func (collection *Collection) Complete(index int, undo bool, recursive bool) error
- func (collection *Collection) DoAct(index int) error
- func (c *Collection) Equal(other any) bool
- func (collection *Collection) Get(index int) *Item
- func (collection *Collection) GetByFilter(tags []string, justCompleted bool, justPending bool) []*Item
- func (collection *Collection) GetChildren(id string) []*Item
- func (collection *Collection) GetTreeList(items []*Item) []string
- func (collection *Collection) GetTreeView(items []*Item) []string
- func (c *Collection) ListBackup(cfg *config.BackupConfig) ([]string, error)
- func (collection *Collection) Merge(other *Collection) (log []string, diffCount int, upload bool)
- func (c *Collection) Parse(data []byte) error
- func (c *Collection) ParseNew(data []byte) (interfaces.Backupable, error)
- func (collection *Collection) Remove(index int) error
- func (collection *Collection) Save(filename string) (err error)
- func (collection *Collection) Sorted() (items []*Item)
- func (collection *Collection) UpdateLevels()
- type Item
Constants ¶
View Source
const ( TimeFormat = "2006-01-02" DateTimeFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" CompletedChar = "✅ " OpenedChar = "" PendingChar = "⌛" ClockChar = "⏱" )
View Source
const BackupFilePrefix = "todo_backup"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶ added in v0.1.0
type Collection struct { Items map[string]*Item `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 LoadFromData ¶ added in v0.1.0
func LoadFromData(data []byte) (collection Collection, err error)
func LoadFromFile ¶ added in v0.1.0
func LoadFromFile(filename string) (collection Collection, err error)
func NewTodoCollection ¶
func NewTodoCollection() *Collection
func (*Collection) Add ¶ added in v0.1.0
func (collection *Collection) Add(item *Item)
func (*Collection) Backup ¶ added in v0.1.0
func (c *Collection) Backup(cfg *config.BackupConfig) (err error)
Backup creates a backup of the collection file
func (*Collection) BackupPrefix ¶ added in v0.1.0
func (c *Collection) BackupPrefix() string
func (*Collection) Complete ¶ added in v0.1.0
func (collection *Collection) Complete(index int, undo bool, recursive bool) error
func (*Collection) DoAct ¶ added in v0.1.0
func (collection *Collection) DoAct(index int) error
func (*Collection) Equal ¶ added in v0.1.0
func (c *Collection) Equal(other any) bool
func (*Collection) Get ¶ added in v0.1.0
func (collection *Collection) Get(index int) *Item
func (*Collection) GetByFilter ¶ added in v0.1.0
func (collection *Collection) GetByFilter(tags []string, justCompleted bool, justPending bool) []*Item
func (*Collection) GetChildren ¶ added in v0.1.0
func (collection *Collection) GetChildren(id string) []*Item
func (*Collection) GetTreeList ¶ added in v0.1.0
func (collection *Collection) GetTreeList(items []*Item) []string
func (*Collection) GetTreeView ¶ added in v0.1.0
func (collection *Collection) GetTreeView(items []*Item) []string
func (*Collection) ListBackup ¶ added in v0.1.0
func (c *Collection) ListBackup(cfg *config.BackupConfig) ([]string, error)
func (*Collection) Merge ¶ added in v0.1.0
func (collection *Collection) Merge(other *Collection) (log []string, diffCount int, upload bool)
func (*Collection) Parse ¶ added in v0.1.0
func (c *Collection) Parse(data []byte) error
func (*Collection) ParseNew ¶ added in v0.1.0
func (c *Collection) ParseNew(data []byte) (interfaces.Backupable, error)
func (*Collection) Remove ¶ added in v0.1.0
func (collection *Collection) Remove(index int) error
func (*Collection) Save ¶ added in v0.1.0
func (collection *Collection) Save(filename string) (err error)
func (*Collection) Sorted ¶ added in v0.1.0
func (collection *Collection) Sorted() (items []*Item)
func (*Collection) UpdateLevels ¶ added in v0.1.0
func (collection *Collection) UpdateLevels()
type Item ¶ added in v0.1.0
type Item 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 (*Item) LevelString ¶ added in v0.1.0
func (*Item) NotifyText ¶ added in v0.1.0
func (*Item) StringNoColor ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.