Documentation
¶
Index ¶
- Constants
- Variables
- func FieldFromBody(field, body string) string
- func FieldFromSubject(field, subject string) string
- func ParseWeekday(wd string) (time.Weekday, bool)
- type Biweekly
- type ByDefault
- type ByDue
- type ById
- type Daily
- type Date
- func (d Date) Add(days int) Date
- func (d Date) AddDays(amount int) Date
- func (d Date) AddMonths(addMonths int) Date
- func (d Date) After(ud Date) bool
- func (d Date) Day() int
- func (d Date) DaysBetween(d2 Date) int
- func (d Date) Equal(ud Date) bool
- func (d Date) Human() string
- func (d Date) IsZero() bool
- func (d *Date) MarshalJSON() ([]byte, error)
- func (d Date) String() string
- func (d Date) Time() time.Time
- func (d *Date) UnmarshalJSON(data []byte) error
- func (d Date) Weekday() time.Weekday
- type EveryNDays
- type EveryNMonths
- type EveryNWeeks
- type LocalTask
- type LocalUpdate
- type Recurrer
- func NewRecurrer(recurStr string) Recurrer
- func ParseBiweekly(start Date, terms []string) (Recurrer, bool)
- func ParseDaily(start Date, terms []string) (Recurrer, bool)
- func ParseEveryNDays(start Date, terms []string) (Recurrer, bool)
- func ParseEveryNMonths(start Date, terms []string) (Recurrer, bool)
- func ParseEveryNWeeks(start Date, terms []string) (Recurrer, bool)
- func ParseWeekly(start Date, terms []string) (Recurrer, bool)
- type Task
- func (t *Task) FormatBody() string
- func (t *Task) FormatSubject() string
- func (t *Task) GenerateFromRecurrer(date Date) (*Task, error)
- func (t *Task) IsRecurrer() bool
- func (t *Task) NextMessage() *mstore.Message
- func (t *Task) RecursOn(date Date) bool
- func (t *Task) RecursToday() bool
- func (t *Task) TargetFolder() string
- type Weekdays
- type Weekly
Constants ¶
View Source
const ( STATUS_FETCHED = "fetched" STATUS_UPDATED = "updated" STATUS_DISPATCHED = "dispatched" )
View Source
const ( FOLDER_INBOX = "Inbox" FOLDER_NEW = "New" FOLDER_RECURRING = "Recurring" FOLDER_PLANNED = "Planned" FOLDER_UNPLANNED = "Unplanned" QUOTE_PREFIX = ">" PREVIOUS_SEPARATOR = "Previous version:" FIELD_SEPARATOR = ":" SUBJECT_SEPARATOR = " - " FIELD_ID = "id" FIELD_VERSION = "version" FIELD_ACTION = "action" FIELD_PROJECT = "project" FIELD_DUE = "due" FIELD_RECUR = "recur" FIELD_DONE = "done" )
View Source
const (
DateFormat = "2006-01-02 (Monday)"
)
Variables ¶
View Source
var ( ErrOutdatedTask = errors.New("task is outdated") ErrTaskIsNotRecurring = errors.New("task is not recurring") )
View Source
var ( KnownFolders = []string{ FOLDER_INBOX, FOLDER_NEW, FOLDER_RECURRING, FOLDER_PLANNED, FOLDER_UNPLANNED, } )
Functions ¶
func FieldFromBody ¶
func FieldFromSubject ¶
Types ¶
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
func NewDateFromString ¶
func (Date) DaysBetween ¶
func (*Date) MarshalJSON ¶
func (*Date) UnmarshalJSON ¶
type EveryNDays ¶
func (EveryNDays) RecursOn ¶
func (nd EveryNDays) RecursOn(date Date) bool
func (EveryNDays) String ¶
func (nd EveryNDays) String() string
type EveryNMonths ¶
func (EveryNMonths) RecursOn ¶
func (enm EveryNMonths) RecursOn(date Date) bool
func (EveryNMonths) String ¶
func (enm EveryNMonths) String() string
type EveryNWeeks ¶
func (EveryNWeeks) RecursOn ¶
func (enw EveryNWeeks) RecursOn(date Date) bool
func (EveryNWeeks) String ¶
func (enw EveryNWeeks) String() string
type LocalTask ¶
type LocalTask struct { Task LocalId int LocalUpdate *LocalUpdate LocalStatus string }
func (*LocalTask) AddUpdate ¶
func (lt *LocalTask) AddUpdate(update *LocalUpdate)
func (*LocalTask) ApplyUpdate ¶
func (lt *LocalTask) ApplyUpdate()
type LocalUpdate ¶
type LocalUpdate struct { ForVersion int Fields []string Action string Project string Due Date Recur Recurrer Done bool }
func (*LocalUpdate) Add ¶
func (lu *LocalUpdate) Add(newUpdate *LocalUpdate)
func (*LocalUpdate) Scan ¶
func (lu *LocalUpdate) Scan(value interface{}) error
type Recurrer ¶
func NewRecurrer ¶
func ParseBiweekly ¶
yyyy-mm-dd, biweekly, wednesday
func ParseEveryNDays ¶
yyyy-mm-dd, every 3 days
func ParseEveryNMonths ¶
yyyy-mm-dd, every 3 months
func ParseEveryNWeeks ¶
yyyy-mm-dd, every 3 weeks
type Task ¶
type Task struct { // Message is the underlying message from which the task was created // It only has meaning for remote repositories and will be nil in // local situations. It will be filtered out in LocalRepository.SetTasks() Message *mstore.Message Id string `json:"id"` Version int `json:"version"` Folder string `json:"folder"` Action string `json:"action"` Project string `json:"project"` Due Date `json:"date"` Recur Recurrer `json:"-"` Done bool `json:"done"` }
func NewFromMessage ¶
func (*Task) FormatBody ¶
func (*Task) FormatSubject ¶
func (*Task) IsRecurrer ¶
func (*Task) NextMessage ¶
func (*Task) RecursToday ¶
func (*Task) TargetFolder ¶
Click to show internal directories.
Click to hide internal directories.