Documentation ¶
Index ¶
- Constants
- Variables
- func GetContentTitle(item ContentCarrier) string
- func GetContentURL(item ContentCarrier) []string
- func HasURL(item ContentCarrier) bool
- func ParseAPIError(prefix string, resp *http.Response) error
- type AbstractItem
- type BaseItem
- type Client
- func (c *Client) AddItem(ctx context.Context, item Item) error
- func (c *Client) AddProject(ctx context.Context, project Project) error
- func (c *Client) CloseItem(ctx context.Context, ids []string) error
- func (c *Client) CompleteItemIDByPrefix(prefix string) (id string, err error)
- func (c *Client) CompletedAll(ctx context.Context, r *Completed) error
- func (c *Client) DeleteItem(ctx context.Context, ids []string) error
- func (c *Client) ExecCommands(ctx context.Context, commands Commands) error
- func (c *Client) Log(format string, v ...interface{})
- func (c *Client) MoveItem(ctx context.Context, item *Item, projectId string) error
- func (c *Client) QuickCommand(ctx context.Context, text string) error
- func (c *Client) Sync(ctx context.Context) error
- func (c *Client) UpdateItem(ctx context.Context, item Item) error
- type Command
- type Commands
- type Completed
- type CompletedItem
- type CompletedItems
- type Config
- type ContentCarrier
- type Due
- type ExecResult
- type HaveID
- type HaveIDs
- type HaveIndent
- type HaveParentID
- type HaveProjectID
- type HaveSectionID
- type IDCarrier
- type Item
- func (item Item) AddParam() interface{}
- func (item Item) DateTime() time.Time
- func (item Item) GetLabelNames() []string
- func (item Item) GetProjectID() string
- func (item Item) LabelsString(store *Store) string
- func (item *Item) MoveParam(projectId string) interface{}
- func (item Item) UpdateParam() interface{}
- type ItemOrder
- type ItemOrders
- type Items
- type Label
- type Labels
- type Order
- type Orders
- type ParentIDCarrier
- type Project
- type ProjectIDCarrier
- type Projects
- type Repository
- type Section
- type Sections
- type Store
- type User
Constants ¶
View Source
const ( RFC3339Date = "2006-01-02" RFC3339DateTime = "2006-01-02T15:04:05" RFC3339DateTimeWithTimeZone = "2006-01-02T15:04:05Z07:00" )
View Source
const (
Server = "https://todoist.com/API/v9/"
)
Variables ¶
View Source
var (
FindFailed = errors.New("Find Failed")
)
Functions ¶
func GetContentTitle ¶
func GetContentTitle(item ContentCarrier) string
func GetContentURL ¶
func GetContentURL(item ContentCarrier) []string
func HasURL ¶
func HasURL(item ContentCarrier) bool
Types ¶
type AbstractItem ¶ added in v0.10.1
interface for Eval actions
type BaseItem ¶
type BaseItem struct { HaveID HaveProjectID Content string `json:"content"` UserID string `json:"user_id"` }
func (BaseItem) GetContent ¶
type Client ¶
func (*Client) AddProject ¶ added in v0.16.0
func (*Client) CompleteItemIDByPrefix ¶ added in v0.11.0
func (*Client) CompletedAll ¶
func (*Client) ExecCommands ¶
func (*Client) QuickCommand ¶ added in v0.10.1
type Command ¶
type Command struct { Args interface{} `json:"args"` TempID string `json:"temp_id"` Type string `json:"type"` UUID string `json:"uuid"` }
func NewCommand ¶
type Completed ¶
type Completed struct { Items CompletedItems `json:"items"` Projects interface{} `json:"projects"` }
type CompletedItem ¶
type CompletedItem struct { BaseItem CompletedData string `json:"completed_at"` MetaData interface{} `json:"meta_data"` TaskID string `json:"task_id"` }
func (CompletedItem) DateTime ¶ added in v0.10.1
func (item CompletedItem) DateTime() time.Time
func (CompletedItem) GetLabelNames ¶ added in v0.17.0
func (item CompletedItem) GetLabelNames() []string
func (CompletedItem) GetProjectID ¶ added in v0.11.0
func (item CompletedItem) GetProjectID() string
type CompletedItems ¶
type CompletedItems []CompletedItem
type ContentCarrier ¶
type ContentCarrier interface {
GetContent() string
}
type ExecResult ¶
type ExecResult struct { SyncToken string `json:"sync_token"` SyncStatus interface{} `json:"sync_status"` TempIdMapping interface{} `json:"temp_id_mapping"` }
type HaveIndent ¶
type HaveIndent struct {
Indent int `json:"indent"`
}
func (HaveIndent) GetIndent ¶
func (carrier HaveIndent) GetIndent() int
type HaveParentID ¶
type HaveParentID struct {
ParentID *string `json:"parent_id"`
}
func (HaveParentID) GetParentID ¶
func (carrier HaveParentID) GetParentID() (string, error)
type HaveProjectID ¶
type HaveProjectID struct {
ProjectID string `json:"project_id"`
}
func (HaveProjectID) GetProjectID ¶
func (carrier HaveProjectID) GetProjectID() string
type HaveSectionID ¶ added in v0.16.0
type HaveSectionID struct {
SectionID string `json:"section_id"`
}
type Item ¶
type Item struct { BaseItem HaveParentID HaveIndent HaveSectionID ChildItem *Item `json:"-"` BrotherItem *Item `json:"-"` AllDay bool `json:"all_day"` AssignedByUID string `json:"assigned_by_uid"` Checked bool `json:"checked"` Collapsed bool `json:"collapsed"` DateAdded string `json:"added_at"` DateLang string `json:"date_lang"` DateString string `json:"date_string"` DayOrder int `json:"day_order"` Due *Due `json:"due"` HasMoreNotes bool `json:"has_more_notes"` IsArchived int `json:"is_archived"` IsDeleted bool `json:"is_deleted"` ItemOrder int `json:"item_order"` LabelNames []string `json:"labels"` Priority int `json:"priority"` AutoReminder bool `json:"auto_reminder"` ResponsibleUID interface{} `json:"responsible_uid"` SyncID interface{} `json:"sync_id"` }
func SearchItemParents ¶ added in v0.14.0
func (Item) GetLabelNames ¶ added in v0.17.0
func (Item) GetProjectID ¶ added in v0.11.0
func (Item) LabelsString ¶
func (Item) UpdateParam ¶
func (item Item) UpdateParam() interface{}
type ItemOrders ¶
type ItemOrders []ItemOrder
func (ItemOrders) Len ¶
func (a ItemOrders) Len() int
func (ItemOrders) Less ¶
func (a ItemOrders) Less(i, j int) bool
func (ItemOrders) Swap ¶
func (a ItemOrders) Swap(i, j int)
type ParentIDCarrier ¶
type Project ¶
type Project struct { HaveID HaveParentID HaveIndent Collapsed bool `json:"collapsed"` Color string `json:"color"` HasMoreNotes bool `json:"has_more_notes"` InboxProject bool `json:"inbox_project"` IsArchived bool `json:"is_archived"` IsDeleted bool `json:"is_deleted"` ItemOrder int `json:"item_order"` Name string `json:"name"` ChildProject *Project `json:"-"` BrotherProject *Project `json:"-"` ViewStyle string `json:"view_style"` }
func SearchProjectParents ¶ added in v0.14.0
type ProjectIDCarrier ¶
type ProjectIDCarrier interface {
GetProjectID() string
}
type Projects ¶
type Projects []Project
func (Projects) GetIDByName ¶ added in v0.11.0
func (Projects) GetIDsByName ¶ added in v0.11.0
type Repository ¶
type Store ¶
type Store struct { CollaboratorStates []interface{} `json:"collaborator_states"` Collaborators []interface{} `json:"collaborators"` DayOrders interface{} `json:"day_orders"` DayOrdersTimestamp string `json:"day_orders_timestamp"` Filters []struct { Color string `json:"color"` ID string `json:"id"` IsDeleted bool `json:"is_deleted"` ItemOrder int `json:"item_order"` Name string `json:"name"` Query string `json:"query"` } `json:"filters"` FullSync bool `json:"full_sync"` Items Items `json:"items"` Labels Labels `json:"labels"` LiveNotifications []struct { CompletedTasks int `json:"completed_tasks"` Created string `json:"created_at"` DateReached string `json:"date_reached"` ID string `json:"id"` IsDeleted bool `json:"is_deleted"` KarmaLevel int `json:"karma_level"` NotificationKey string `json:"notification_key"` NotificationType string `json:"notification_type"` PromoImg string `json:"promo_img"` SeqNo int64 `json:"seq_no"` TopProcent float32 `json:"top_procent"` } `json:"live_notifications"` LiveNotificationsLastReadID string `json:"live_notifications_last_read_id"` Locations []interface{} `json:"locations"` Notes []struct { Content string `json:"content"` FileAttachment interface{} `json:"file_attachment"` ID string `json:"id"` IsArchived int `json:"is_archived"` IsDeleted bool `json:"is_deleted"` ItemID string `json:"item_id"` Posted string `json:"posted_at"` PostedUID string `json:"posted_uid"` ProjectID *string `json:"project_id"` UidsToNotify interface{} `json:"uids_to_notify"` } `json:"notes"` ProjectNotes []interface{} `json:"project_notes"` Projects Projects `json:"projects"` Sections Sections `json:"sections"` Reminders []struct { DateLang string `json:"date_lang"` Due *Due `json:"due"` ID string `json:"id"` IsDeleted bool `json:"is_deleted"` ItemID string `json:"item_id"` MinuteOffset int `json:"minute_offset"` NotifyUID string `json:"notify_uid"` Service interface{} `json:"service"` Type string `json:"type"` } `json:"reminders"` SyncToken string `json:"sync_token"` TempIDMapping struct{} `json:"temp_id_mapping"` User User `json:"user"` RootItem *Item `json:"-"` RootProject *Project `json:"-"` ItemMap map[string]*Item `json:"-"` ProjectMap map[string]*Project `json:"-"` LabelMap map[string]*Label `json:"-"` SectionMap map[string]*Section `json:"-"` }
func (*Store) ConstructItemTree ¶ added in v0.14.0
func (s *Store) ConstructItemTree()
func (*Store) FindProject ¶ added in v0.14.0
func (*Store) FindSection ¶ added in v0.16.0
type User ¶
type User struct { AutoReminder int `json:"auto_reminder"` AvatarBig string `json:"avatar_big"` AvatarMedium string `json:"avatar_medium"` AvatarS640 string `json:"avatar_s640"` AvatarSmall string `json:"avatar_small"` BusinessAccountID interface{} `json:"business_account_id"` CompletedCount int `json:"completed_count"` CompletedToday int `json:"completed_today"` DailyGoal int `json:"daily_goal"` DateFormat int `json:"date_format"` Email string `json:"email"` Features struct { Beta int `json:"beta"` GoldTheme bool `json:"gold_theme"` HasPushReminders bool `json:"has_push_reminders"` Restriction int `json:"restriction"` } `json:"features"` FullName string `json:"full_name"` ID string `json:"id"` ImageID string `json:"image_id"` InboxProjectID string `json:"inbox_project_id"` IsBizAdmin bool `json:"is_biz_admin"` IsPremium bool `json:"is_premium"` JoinDate string `json:"joined_at"` Karma float32 `json:"karma"` KarmaTrend string `json:"karma_trend"` NextWeek int `json:"next_week"` PremiumUntil string `json:"premium_until"` SortOrder int `json:"sort_order"` StartDay int `json:"start_day"` StartPage string `json:"start_page"` ThemeID string `json:"theme_id"` TimeFormat int `json:"time_format"` Token string `json:"token"` TzInfo struct { GmtString string `json:"gmt_string"` Hours int `json:"hours"` IsDst int `json:"is_dst"` Minutes int `json:"minutes"` Timezone string `json:"timezone"` } `json:"tz_info"` }
Click to show internal directories.
Click to hide internal directories.