Documentation ¶
Overview ¶
The vdir package implements a simple library to interact with vdir filesystem storage: https://vdirsyncer.pimutils.org/en/stable/vdir.html
Index ¶
- Constants
- func GenerateUID() string
- type ByCreated
- type ByDue
- type ByPriority
- type ByStatus
- type ByTags
- type ByTagsExcluded
- type ByText
- type Collection
- type DecodeError
- type FormatFullOption
- type FormatOption
- type Item
- func (i *Item) Format(options ...FormatOption) (string, error)
- func (i *Item) FormatFull(options ...FormatFullOption) (string, error)
- func (i *Item) HasTag(t Tag) (bool, error)
- func (i *Item) Init(path string) error
- func (i *Item) Tags() (tags []Tag, err error)
- func (i *Item) Vtodo() (*ical.Component, error)
- func (i *Item) WriteFile() error
- type Tag
- type ToDoPriority
- type ToDoStatus
- type Vdir
Constants ¶
const ( MetaDisplayName = "displayname" // MetaDisplayName is a filename vdir uses for collection name MetaColor = "color" // MetaColor is a filename vdir uses for collection color )
const ( StatusCompleted ToDoStatus = "COMPLETED" StatusNeedsAction ToDoStatus = "NEEDS-ACTION" StatusCancelled ToDoStatus = "CANCELLED" StatusInProcess ToDoStatus = "IN-PROCESS" StatusAny ToDoStatus = "ANY" PriorityHigh ToDoPriority = 1 PriorityMedium ToDoPriority = 5 PriorityLow ToDoPriority = 6 )
Variables ¶
This section is empty.
Functions ¶
func GenerateUID ¶
func GenerateUID() string
GenerateUID returns a random string containing timestamp and hostname
Types ¶
type ByPriority ¶
type ByPriority []*Item
func (ByPriority) Len ¶
func (s ByPriority) Len() int
func (ByPriority) Less ¶
func (s ByPriority) Less(i, j int) bool
func (ByPriority) Swap ¶
func (s ByPriority) Swap(i, j int)
type ByTagsExcluded ¶ added in v0.3.0
type ByTagsExcluded []*Item
func (ByTagsExcluded) Items ¶ added in v0.3.0
func (f ByTagsExcluded) Items() []*Item
type Collection ¶
Collection is a Vdir collection
func (*Collection) Init ¶
func (c *Collection) Init(path string) error
Init initializes a Collection with a path, name and color parsed from path
func (*Collection) String ¶
func (c *Collection) String() string
type DecodeError ¶
DecodeError is an error occured during ical decoding
func (*DecodeError) Error ¶
func (d *DecodeError) Error() string
type FormatOption ¶
type FormatOption int
const ( FormatMultiline FormatOption = iota FormatDescription )
type Item ¶
Item is an iCalendar item with a unique id
func (*Item) Format ¶
func (i *Item) Format(options ...FormatOption) (string, error)
Format returns a readable representation of an item
func (*Item) FormatFull ¶
func (i *Item) FormatFull(options ...FormatFullOption) (string, error)
FormatFull returns a full detailed info about an item
type ToDoPriority ¶
type ToDoPriority int
type ToDoStatus ¶
type ToDoStatus string
func (ToDoStatus) String ¶ added in v0.3.0
func (s ToDoStatus) String() string
String returns a lowercased todo status string
type Vdir ¶
type Vdir map[*Collection][]*Item
Vdir is a map of all collections and items
func (*Vdir) Init ¶
Init initializes the map with collections and items in path, items have unique IDs
func (*Vdir) ItemByPath ¶
ItemByPath finds and returns an item for specified path