Documentation ¶
Index ¶
- func IsTempID(id ID) bool
- func IsValidID(id ID) bool
- type Client
- type ColorStringer
- type Command
- type CompletedClient
- type CompletedItems
- type Due
- type Entity
- type FileAttachment
- type Filter
- type FilterClient
- func (c *FilterClient) Add(filter Filter) (*Filter, error)
- func (c *FilterClient) Delete(id ID) error
- func (c FilterClient) FindByName(substr string) []Filter
- func (c *FilterClient) Get(ctx context.Context, id ID) (*FilterGetResponse, error)
- func (c *FilterClient) GetAll() []Filter
- func (c *FilterClient) Resolve(id ID) *Filter
- func (c *FilterClient) Update(filter Filter) (*Filter, error)
- func (c *FilterClient) UpdateOrders(filters []Filter) error
- type FilterGetResponse
- type ID
- type Identifier
- type IntBool
- type Item
- type ItemClient
- func (c *ItemClient) Add(item Item) (*Item, error)
- func (c *ItemClient) Close(id ID) error
- func (c *ItemClient) Complete(id ID, dateCompleted Time, forceHistory bool) error
- func (c *ItemClient) Delete(id ID) error
- func (c ItemClient) FindByContent(substr string) []Item
- func (c ItemClient) FindByDueDate(time Time) []Item
- func (c ItemClient) FindByProjectIDs(ids []ID) []Item
- func (c *ItemClient) Get(ctx context.Context, id ID) (*ItemGetResponse, error)
- func (c *ItemClient) GetAll() []Item
- func (c *ItemClient) GetCompleted(ctx context.Context, projectID ID) (*[]Item, error)
- func (c *ItemClient) Move(id ID, opts *ItemMoveOpts) error
- func (c *ItemClient) Resolve(id ID) *Item
- func (c *ItemClient) Uncomplete(id ID) error
- func (c *ItemClient) Update(item Item) (*Item, error)
- type ItemGetResponse
- type ItemMoveOpts
- type ItemRelations
- type Label
- type LabelClient
- func (c *LabelClient) Add(label Label) (*Label, error)
- func (c *LabelClient) Delete(id ID) error
- func (c LabelClient) FindByName(substr string) []Label
- func (c LabelClient) FindOneByName(substr string) *Label
- func (c *LabelClient) Get(ctx context.Context, id ID) (*LabelGetResponse, error)
- func (c *LabelClient) GetAll() []Label
- func (c *LabelClient) Resolve(id ID) *Label
- func (c *LabelClient) Update(label Label) (*Label, error)
- func (c *LabelClient) UpdateOrders(labels []Label) error
- type LabelGetResponse
- type Labels
- type NewFilterOpts
- type NewItemOpts
- type NewLabelOpts
- type NewNoteOpts
- type NewProjectOpts
- type NoColorString
- type Note
- type NoteClient
- type Project
- type ProjectClient
- func (c *ProjectClient) Add(project Project) (*Project, error)
- func (c *ProjectClient) Archive(id ID) error
- func (c *ProjectClient) Delete(id ID) error
- func (c ProjectClient) FindByName(substr string) []Project
- func (c ProjectClient) FindOneByName(substr string) *Project
- func (c *ProjectClient) Get(ctx context.Context, id ID) (*ProjectGetResponse, error)
- func (c *ProjectClient) GetAll() []Project
- func (c *ProjectClient) GetArchived(ctx context.Context) (*[]Project, error)
- func (c *ProjectClient) GetData(ctx context.Context, id ID) (*ProjectGetDataResponse, error)
- func (c *ProjectClient) Move(id, parentID ID) error
- func (c *ProjectClient) Reorder(projects []Project) error
- func (c *ProjectClient) Resolve(id ID) *Project
- func (c *ProjectClient) Unarchive(id ID) error
- func (c *ProjectClient) Update(project Project) (*Project, error)
- type ProjectGetDataResponse
- type ProjectGetResponse
- type RelationClient
- type Reminder
- type Resolver
- type Stats
- type SyncState
- type Time
- func (t Time) After(u Time) bool
- func (t Time) Before(u Time) bool
- func (t Time) ColorString() string
- func (t Time) Equal(u Time) bool
- func (t Time) IsFullDay() bool
- func (t Time) Local() Time
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) String() string
- func (t *Time) UnmarshalJSON(b []byte) (err error)
- type UUID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { URL *url.URL HTTPClient *http.Client Token string SyncToken string CacheDir string Logger *log.Logger Completed *CompletedClient Filter *FilterClient Item *ItemClient Label *LabelClient Project *ProjectClient Relation *RelationClient Note *NoteClient // contains filtered or unexported fields }
func (*Client) ResetSyncToken ¶
func (c *Client) ResetSyncToken()
type ColorStringer ¶
type CompletedClient ¶
type CompletedClient struct {
*Client
}
func (*CompletedClient) GetAll ¶
func (c *CompletedClient) GetAll() (*CompletedItems, error)
func (*CompletedClient) GetStats ¶
func (c *CompletedClient) GetStats() (*Stats, error)
type CompletedItems ¶
type CompletedItems struct { Items []Item `json:"items"` Projects map[ID]Project `json:"projects"` }
func (*CompletedItems) GroupByCompletedDate ¶
func (c *CompletedItems) GroupByCompletedDate() map[string][]Item
type FileAttachment ¶ added in v0.2.0
type Filter ¶
type Filter struct { Entity Name string `json:"name"` Query string `json:"query"` Color int `json:"color"` ItemOrder int `json:"item_order"` IsFavorite IntBool `json:"is_favorite"` }
func NewFilter ¶ added in v0.2.0
func NewFilter(name, query string, opts *NewFilterOpts) (*Filter, error)
func (Filter) ColorString ¶
type FilterClient ¶
type FilterClient struct { *Client // contains filtered or unexported fields }
func (*FilterClient) Delete ¶
func (c *FilterClient) Delete(id ID) error
func (FilterClient) FindByName ¶
func (c FilterClient) FindByName(substr string) []Filter
func (*FilterClient) Get ¶
func (c *FilterClient) Get(ctx context.Context, id ID) (*FilterGetResponse, error)
func (*FilterClient) GetAll ¶
func (c *FilterClient) GetAll() []Filter
func (*FilterClient) Resolve ¶
func (c *FilterClient) Resolve(id ID) *Filter
func (*FilterClient) UpdateOrders ¶ added in v0.2.0
func (c *FilterClient) UpdateOrders(filters []Filter) error
type FilterGetResponse ¶
type FilterGetResponse struct {
Filter Filter
}
type ID ¶
type ID string
func GenerateTempID ¶
func GenerateTempID() ID
func (ID) MarshalJSON ¶
func (*ID) UnmarshalJSON ¶
type Identifier ¶
type Identifier interface { Equal(id Identifier) bool // contains filtered or unexported methods }
type Item ¶
type Item struct { Entity UserID ID `json:"user_id,omitempty"` ProjectID ID `json:"project_id,omitempty"` Content string `json:"content"` Due Due `json:"due,omitempty"` Priority int `json:"priority,omitempty"` ParentID ID `json:"parent_id,omitempty"` ChildOrder int `json:"child_order,omitempty"` DayOrder int `json:"day_order,omitempty"` Collapsed IntBool `json:"collapsed,omitempty"` Labels []ID `json:"labels,omitempty"` AssignedByUID ID `json:"assigned_by_uid,omitempty"` ResponsibleUID ID `json:"responsible_uid,omitempty"` Checked IntBool `json:"checked,omitempty"` InHistory IntBool `json:"in_history,omitempty"` SyncID int `json:"sync_id,omitempty"` DateAdded Time `json:"date_added,omitempty"` CompletedDate Time `json:"completed_date"` }
func (Item) IsOverDueDate ¶
type ItemClient ¶
type ItemClient struct { *Client // contains filtered or unexported fields }
func (*ItemClient) Close ¶
func (c *ItemClient) Close(id ID) error
func (*ItemClient) Complete ¶
func (c *ItemClient) Complete(id ID, dateCompleted Time, forceHistory bool) error
func (*ItemClient) Delete ¶
func (c *ItemClient) Delete(id ID) error
func (ItemClient) FindByContent ¶
func (c ItemClient) FindByContent(substr string) []Item
func (ItemClient) FindByDueDate ¶
func (c ItemClient) FindByDueDate(time Time) []Item
func (ItemClient) FindByProjectIDs ¶
func (c ItemClient) FindByProjectIDs(ids []ID) []Item
func (*ItemClient) Get ¶
func (c *ItemClient) Get(ctx context.Context, id ID) (*ItemGetResponse, error)
func (*ItemClient) GetAll ¶
func (c *ItemClient) GetAll() []Item
func (*ItemClient) GetCompleted ¶
func (*ItemClient) Move ¶
func (c *ItemClient) Move(id ID, opts *ItemMoveOpts) error
func (*ItemClient) Resolve ¶
func (c *ItemClient) Resolve(id ID) *Item
func (*ItemClient) Uncomplete ¶
func (c *ItemClient) Uncomplete(id ID) error
type ItemGetResponse ¶
type ItemMoveOpts ¶ added in v0.2.0
type ItemRelations ¶
type Label ¶
type Label struct { Entity Name string `json:"name"` Color int `json:"color"` ItemOrder int `json:"item_order"` IsFavorite IntBool `json:"is_favorite"` }
func (Label) ColorString ¶
type LabelClient ¶
type LabelClient struct { *Client // contains filtered or unexported fields }
func (*LabelClient) Delete ¶
func (c *LabelClient) Delete(id ID) error
func (LabelClient) FindByName ¶
func (c LabelClient) FindByName(substr string) []Label
func (LabelClient) FindOneByName ¶ added in v0.1.3
func (c LabelClient) FindOneByName(substr string) *Label
func (*LabelClient) Get ¶
func (c *LabelClient) Get(ctx context.Context, id ID) (*LabelGetResponse, error)
func (*LabelClient) GetAll ¶
func (c *LabelClient) GetAll() []Label
func (*LabelClient) Resolve ¶
func (c *LabelClient) Resolve(id ID) *Label
func (*LabelClient) UpdateOrders ¶ added in v0.2.0
func (c *LabelClient) UpdateOrders(labels []Label) error
type LabelGetResponse ¶
type LabelGetResponse struct {
Label Label
}
type NewFilterOpts ¶ added in v0.2.0
type NewItemOpts ¶ added in v0.2.0
type NewLabelOpts ¶ added in v0.2.0
type NewNoteOpts ¶ added in v0.2.0
type NewNoteOpts struct { FileAttachment FileAttachment UIDsToNotify []ID }
type NewProjectOpts ¶ added in v0.2.0
type NoColorString ¶
type NoColorString struct {
// contains filtered or unexported fields
}
func NewNoColorString ¶
func NewNoColorString(s string) NoColorString
func (NoColorString) ColorString ¶
func (n NoColorString) ColorString() string
func (NoColorString) String ¶
func (n NoColorString) String() string
type Note ¶
type Note struct { Entity PostedUID ID `json:"posted_uid"` ItemID ID `json:"item_id"` ProjectID ID `json:"project_id"` Content string `json:"content"` FileAttachment FileAttachment `json:"file_attachment"` UIDsToNotify []ID `json:"uids_to_notify"` Posted Time `json:"posted"` Reactions map[string][]ID `json:"reactions"` }
type NoteClient ¶
type NoteClient struct { *Client // contains filtered or unexported fields }
NoteClient encapsulate client operations for notes.
func (NoteClient) Delete ¶ added in v0.2.0
func (c NoteClient) Delete(id ID) error
func (NoteClient) GetAllForItem ¶
func (c NoteClient) GetAllForItem(itemID ID) []Note
GetAllForItem returns all the cached notes that belong to the given item.
func (NoteClient) GetAllForProject ¶
func (c NoteClient) GetAllForProject(projectID ID) []Note
GetAllForProject returns all the cached notes that belong to the given project.
type Project ¶
type Project struct { Entity Name string `json:"name"` Color int `json:"color"` ChildOrder int `json:"child_order"` ParentID ID `json:"parent_id"` Collapsed IntBool `json:"collapsed"` IsArchived IntBool `json:"is_archived"` IsFavorite IntBool `json:"is_favorite"` InboxProject bool `json:"inbox_project"` TeamInbox bool `json:"team_inbox"` }
func NewProject ¶ added in v0.2.0
func NewProject(name string, opts *NewProjectOpts) (*Project, error)
func (Project) ColorString ¶
type ProjectClient ¶
type ProjectClient struct { *Client // contains filtered or unexported fields }
func (*ProjectClient) Archive ¶
func (c *ProjectClient) Archive(id ID) error
func (*ProjectClient) Delete ¶
func (c *ProjectClient) Delete(id ID) error
func (ProjectClient) FindByName ¶
func (c ProjectClient) FindByName(substr string) []Project
func (ProjectClient) FindOneByName ¶ added in v0.1.3
func (c ProjectClient) FindOneByName(substr string) *Project
func (*ProjectClient) Get ¶
func (c *ProjectClient) Get(ctx context.Context, id ID) (*ProjectGetResponse, error)
func (*ProjectClient) GetAll ¶
func (c *ProjectClient) GetAll() []Project
func (*ProjectClient) GetArchived ¶
func (c *ProjectClient) GetArchived(ctx context.Context) (*[]Project, error)
func (*ProjectClient) GetData ¶
func (c *ProjectClient) GetData(ctx context.Context, id ID) (*ProjectGetDataResponse, error)
func (*ProjectClient) Move ¶ added in v0.2.0
func (c *ProjectClient) Move(id, parentID ID) error
func (*ProjectClient) Reorder ¶ added in v0.2.0
func (c *ProjectClient) Reorder(projects []Project) error
func (*ProjectClient) Resolve ¶
func (c *ProjectClient) Resolve(id ID) *Project
func (*ProjectClient) Unarchive ¶
func (c *ProjectClient) Unarchive(id ID) error
type ProjectGetDataResponse ¶
type ProjectGetResponse ¶
type RelationClient ¶
type RelationClient struct {
*Client
}
func (RelationClient) Items ¶
func (c RelationClient) Items(items []Item) ItemRelations
type Reminder ¶
type Reminder struct { Entity NotifyUID ID `json:"notify_uid"` ItemID ID `json:"item_id"` Service string `json:"service"` Type string `json:"type"` Due Due `json:"due"` MmOffset int `json:"mm_offset"` Name string `json:"name"` LocLat string `json:"loc_lat"` LocLong string `json:"loc_long"` LocTrigger string `json:"loc_trigger"` Radius int `json:"radius"` }
type Stats ¶
type Stats struct { KarmaLastUpdate float64 `json:"karma_last_update"` KarmaTrend string `json:"karma_trend"` DaysItems []struct { Date string `json:"date"` Items []struct { Completed int `json:"completed"` ID int `json:"id"` } `json:"items"` TotalCompleted int `json:"total_completed"` } `json:"days_items"` CompletedCount int `json:"completed_count"` KarmaUpdateReasons []struct { PositiveKarmaReasons []int `json:"positive_karma_reasons"` NewKarma float64 `json:"new_karma"` NegativeKarma float64 `json:"negative_karma"` PositiveKarma float64 `json:"positive_karma"` NegativeKarmaReasons []int `json:"negative_karma_reasons"` Time string `json:"time"` } `json:"karma_update_reasons"` Karma float64 `json:"karma"` WeekItems []struct { Date string `json:"date"` Items []struct { Completed int `json:"completed"` ID int `json:"id"` } `json:"items"` TotalCompleted int `json:"total_completed"` } `json:"week_items"` KarmaGraph string `json:"karma_graph"` Goals struct { KarmaDisabled int `json:"karma_disabled"` UserID int `json:"user_id"` LastDailyStreak struct { Count int `json:"count"` Start string `json:"start"` End string `json:"end"` } `json:"last_daily_streak"` VacationMode int `json:"vacation_mode"` IgnoreDays []int `json:"ignore_days"` MaxWeeklyStreak struct { Count int `json:"count"` Start string `json:"start"` End string `json:"end"` } `json:"max_weekly_streak"` CurrentWeeklyStreak struct { Count int `json:"count"` Start string `json:"start"` End string `json:"end"` } `json:"current_weekly_streak"` CurrentDailyStreak struct { Count int `json:"count"` Start string `json:"start"` End string `json:"end"` } `json:"current_daily_streak"` LastWeeklyStreak struct { Count int `json:"count"` Start string `json:"start"` End string `json:"end"` } `json:"last_weekly_streak"` WeeklyGoal int `json:"weekly_goal"` MaxDailyStreak struct { Count int `json:"count"` Start string `json:"start"` End string `json:"end"` } `json:"max_daily_streak"` DailyGoal int `json:"daily_goal"` } `json:"goals"` }
type SyncState ¶
type SyncState struct { SyncToken string `json:"sync_token"` FullSync bool `json:"full_sync"` // User User `json:"user"` Projects []Project `json:"projects"` ProjectNotes []Note `json:"project_notes"` Items []Item `json:"items"` Notes []Note `json:"notes"` Labels []Label `json:"labels"` Filters []Filter `json:"filters"` // DayOrders struct {} `json:"day_orders"` // DayOrdersTimestamp string `json:"day_orders_timestamp"` Reminders []Reminder `json:"reminders"` }
Click to show internal directories.
Click to hide internal directories.