Documentation
¶
Overview ¶
Package sync provides a persistent sync engine for Things Cloud. It stores state in SQLite and surfaces semantic change events.
Example ¶
package main
import (
"fmt"
"log"
"os"
things "github.com/pdurlej/things-cloud-sdk"
"github.com/pdurlej/things-cloud-sdk/sync"
)
func main() {
// Create Things Cloud client
client := things.New(
things.APIEndpoint,
os.Getenv("THINGS_USERNAME"),
os.Getenv("THINGS_PASSWORD"),
)
// Open sync database (creates if doesn't exist)
syncer, err := sync.Open("~/.things-agent/state.db", client)
if err != nil {
log.Fatal(err)
}
defer syncer.Close()
// Sync and get changes
changes, err := syncer.Sync()
if err != nil {
log.Fatal(err)
}
// React to changes
for _, c := range changes {
switch e := c.(type) {
case sync.TaskCreated:
fmt.Printf("New task: %s\n", e.Task.Title)
case sync.TaskCompleted:
fmt.Printf("Completed: %s\n", e.Task.Title)
case sync.TaskMovedToToday:
fmt.Printf("Scheduled for today: %s (was in %s)\n", e.Task.Title, e.From)
case sync.AreaCreated:
fmt.Printf("New area: %s\n", e.Area.Title)
}
}
// Query current state
state := syncer.State()
inbox, _ := state.TasksInInbox(sync.QueryOpts{})
fmt.Printf("\nInbox has %d items\n", len(inbox))
projects, _ := state.AllProjects(sync.QueryOpts{})
fmt.Printf("You have %d active projects\n", len(projects))
}
Output:
Index ¶
- type AreaCreated
- type AreaDeleted
- type AreaRenamed
- type Change
- type ChecklistItemCompleted
- type ChecklistItemCreated
- type ChecklistItemDeleted
- type ChecklistItemTitleChanged
- type ChecklistItemUncompleted
- type HeadingCreated
- type HeadingDeleted
- type HeadingTitleChanged
- type LoggedChange
- type ProjectCompleted
- type ProjectCreated
- type ProjectDeleted
- type ProjectRestored
- type ProjectTitleChanged
- type ProjectTrashed
- type QueryOpts
- type State
- func (st *State) AllAreas() ([]*things.Area, error)
- func (st *State) AllHeadings(opts QueryOpts) ([]*things.Task, error)
- func (st *State) AllProjects(opts QueryOpts) ([]*things.Task, error)
- func (st *State) AllTags() ([]*things.Tag, error)
- func (st *State) AllTasks(opts QueryOpts) ([]*things.Task, error)
- func (st *State) Area(uuid string) (*things.Area, error)
- func (st *State) ChecklistItems(taskUUID string) ([]*things.CheckListItem, error)
- func (st *State) HeadingsInProject(projectUUID string, opts QueryOpts) ([]*things.Task, error)
- func (st *State) SearchTasks(query string, opts QueryOpts) ([]*things.Task, error)
- func (st *State) Tag(uuid string) (*things.Tag, error)
- func (st *State) Task(uuid string) (*things.Task, error)
- func (st *State) TasksInAnytime(opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksInArea(areaUUID string, opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksInInbox(opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksInProject(projectUUID string, opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksInSomeday(opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksInToday(opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksInUpcoming(opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksUnderHeading(headingUUID string, opts QueryOpts) ([]*things.Task, error)
- func (st *State) TasksWithTag(tagUUID string, opts QueryOpts) ([]*things.Task, error)
- type Syncer
- func (s *Syncer) ChangesForEntity(entityUUID string) ([]Change, error)
- func (s *Syncer) ChangesSince(timestamp time.Time) ([]Change, error)
- func (s *Syncer) ChangesSinceIndex(serverIndex int) ([]Change, error)
- func (s *Syncer) Close() error
- func (s *Syncer) LastSyncedIndex() int
- func (s *Syncer) QuickSync() ([]Change, error)
- func (s *Syncer) State() *State
- func (s *Syncer) Sync() ([]Change, error)
- type TagCreated
- type TagDeleted
- type TagRenamed
- type TagShortcutChanged
- type TaskAssignedToArea
- type TaskAssignedToProject
- type TaskCanceled
- type TaskCompleted
- type TaskCreated
- type TaskDeadlineChanged
- type TaskDeleted
- type TaskLocation
- type TaskMovedToAnytime
- type TaskMovedToInbox
- type TaskMovedToSomeday
- type TaskMovedToToday
- type TaskMovedToUpcoming
- type TaskNoteChanged
- type TaskRestored
- type TaskTagsChanged
- type TaskTitleChanged
- type TaskTrashed
- type TaskUncompleted
- type UnknownChange
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AreaCreated ¶
type AreaCreated struct {
// contains filtered or unexported fields
}
AreaCreated indicates a new area was created
func (AreaCreated) ChangeType ¶
func (c AreaCreated) ChangeType() string
ChangeType returns "AreaCreated"
func (AreaCreated) EntityType ¶
func (a AreaCreated) EntityType() string
EntityType returns "Area" for all area changes
func (AreaCreated) EntityUUID ¶
func (a AreaCreated) EntityUUID() string
EntityUUID returns the UUID of the area
type AreaDeleted ¶
type AreaDeleted struct {
// contains filtered or unexported fields
}
AreaDeleted indicates an area was permanently deleted
func (AreaDeleted) ChangeType ¶
func (c AreaDeleted) ChangeType() string
ChangeType returns "AreaDeleted"
func (AreaDeleted) EntityType ¶
func (a AreaDeleted) EntityType() string
EntityType returns "Area" for all area changes
func (AreaDeleted) EntityUUID ¶
func (a AreaDeleted) EntityUUID() string
EntityUUID returns the UUID of the area
type AreaRenamed ¶
type AreaRenamed struct {
OldTitle string
// contains filtered or unexported fields
}
AreaRenamed indicates an area's title was modified
func (AreaRenamed) ChangeType ¶
func (c AreaRenamed) ChangeType() string
ChangeType returns "AreaRenamed"
func (AreaRenamed) EntityType ¶
func (a AreaRenamed) EntityType() string
EntityType returns "Area" for all area changes
func (AreaRenamed) EntityUUID ¶
func (a AreaRenamed) EntityUUID() string
EntityUUID returns the UUID of the area
type Change ¶
type Change interface {
// ChangeType returns the type of change (e.g., "TaskCreated", "TaskCompleted")
ChangeType() string
// EntityType returns the type of entity (e.g., "Task", "Area", "Tag")
EntityType() string
// EntityUUID returns the UUID of the affected entity
EntityUUID() string
// ServerIndex returns the server index at which this change occurred
ServerIndex() int
// Timestamp returns when this change was synced
Timestamp() time.Time
}
Change represents a semantic change event from sync
type ChecklistItemCompleted ¶
ChecklistItemCompleted indicates a checklist item was marked as completed
func (ChecklistItemCompleted) ChangeType ¶
func (c ChecklistItemCompleted) ChangeType() string
ChangeType returns "ChecklistItemCompleted"
func (ChecklistItemCompleted) EntityType ¶
func (c ChecklistItemCompleted) EntityType() string
EntityType returns "ChecklistItem" for all checklist item changes
func (ChecklistItemCompleted) EntityUUID ¶
func (c ChecklistItemCompleted) EntityUUID() string
EntityUUID returns the UUID of the checklist item
type ChecklistItemCreated ¶
ChecklistItemCreated indicates a new checklist item was created
func (ChecklistItemCreated) ChangeType ¶
func (c ChecklistItemCreated) ChangeType() string
ChangeType returns "ChecklistItemCreated"
func (ChecklistItemCreated) EntityType ¶
func (c ChecklistItemCreated) EntityType() string
EntityType returns "ChecklistItem" for all checklist item changes
func (ChecklistItemCreated) EntityUUID ¶
func (c ChecklistItemCreated) EntityUUID() string
EntityUUID returns the UUID of the checklist item
type ChecklistItemDeleted ¶
type ChecklistItemDeleted struct {
// contains filtered or unexported fields
}
ChecklistItemDeleted indicates a checklist item was permanently deleted
func (ChecklistItemDeleted) ChangeType ¶
func (c ChecklistItemDeleted) ChangeType() string
ChangeType returns "ChecklistItemDeleted"
func (ChecklistItemDeleted) EntityType ¶
func (c ChecklistItemDeleted) EntityType() string
EntityType returns "ChecklistItem" for all checklist item changes
func (ChecklistItemDeleted) EntityUUID ¶
func (c ChecklistItemDeleted) EntityUUID() string
EntityUUID returns the UUID of the checklist item
type ChecklistItemTitleChanged ¶
type ChecklistItemTitleChanged struct {
OldTitle string
// contains filtered or unexported fields
}
ChecklistItemTitleChanged indicates a checklist item's title was modified
func (ChecklistItemTitleChanged) ChangeType ¶
func (c ChecklistItemTitleChanged) ChangeType() string
ChangeType returns "ChecklistItemTitleChanged"
func (ChecklistItemTitleChanged) EntityType ¶
func (c ChecklistItemTitleChanged) EntityType() string
EntityType returns "ChecklistItem" for all checklist item changes
func (ChecklistItemTitleChanged) EntityUUID ¶
func (c ChecklistItemTitleChanged) EntityUUID() string
EntityUUID returns the UUID of the checklist item
type ChecklistItemUncompleted ¶
type ChecklistItemUncompleted struct {
Task *things.Task
// contains filtered or unexported fields
}
ChecklistItemUncompleted indicates a checklist item was marked as incomplete
func (ChecklistItemUncompleted) ChangeType ¶
func (c ChecklistItemUncompleted) ChangeType() string
ChangeType returns "ChecklistItemUncompleted"
func (ChecklistItemUncompleted) EntityType ¶
func (c ChecklistItemUncompleted) EntityType() string
EntityType returns "ChecklistItem" for all checklist item changes
func (ChecklistItemUncompleted) EntityUUID ¶
func (c ChecklistItemUncompleted) EntityUUID() string
EntityUUID returns the UUID of the checklist item
type HeadingCreated ¶
HeadingCreated indicates a new heading was created
func (HeadingCreated) ChangeType ¶
func (c HeadingCreated) ChangeType() string
ChangeType returns "HeadingCreated"
func (HeadingCreated) EntityType ¶
func (h HeadingCreated) EntityType() string
EntityType returns "Heading" for all heading changes
func (HeadingCreated) EntityUUID ¶
func (h HeadingCreated) EntityUUID() string
EntityUUID returns the UUID of the heading
type HeadingDeleted ¶
type HeadingDeleted struct {
// contains filtered or unexported fields
}
HeadingDeleted indicates a heading was permanently deleted
func (HeadingDeleted) ChangeType ¶
func (c HeadingDeleted) ChangeType() string
ChangeType returns "HeadingDeleted"
func (HeadingDeleted) EntityType ¶
func (h HeadingDeleted) EntityType() string
EntityType returns "Heading" for all heading changes
func (HeadingDeleted) EntityUUID ¶
func (h HeadingDeleted) EntityUUID() string
EntityUUID returns the UUID of the heading
type HeadingTitleChanged ¶
type HeadingTitleChanged struct {
OldTitle string
// contains filtered or unexported fields
}
HeadingTitleChanged indicates a heading's title was modified
func (HeadingTitleChanged) ChangeType ¶
func (c HeadingTitleChanged) ChangeType() string
ChangeType returns "HeadingTitleChanged"
func (HeadingTitleChanged) EntityType ¶
func (h HeadingTitleChanged) EntityType() string
EntityType returns "Heading" for all heading changes
func (HeadingTitleChanged) EntityUUID ¶
func (h HeadingTitleChanged) EntityUUID() string
EntityUUID returns the UUID of the heading
type LoggedChange ¶
type LoggedChange struct {
// contains filtered or unexported fields
}
LoggedChange represents a semantic change restored from the persisted change log. It preserves the stored change type and metadata, but not type-specific fields that are not persisted in the current schema.
func (LoggedChange) ChangeType ¶
func (c LoggedChange) ChangeType() string
ChangeType returns the persisted semantic change type.
func (LoggedChange) EntityType ¶
func (c LoggedChange) EntityType() string
EntityType returns the persisted entity type.
func (LoggedChange) EntityUUID ¶
func (c LoggedChange) EntityUUID() string
EntityUUID returns the persisted entity UUID.
func (LoggedChange) Payload ¶
func (c LoggedChange) Payload() string
Payload returns the raw item payload stored with the change log entry.
func (LoggedChange) ServerIndex ¶
func (b LoggedChange) ServerIndex() int
ServerIndex returns the server index at which this change occurred
type ProjectCompleted ¶
type ProjectCompleted struct {
// contains filtered or unexported fields
}
ProjectCompleted indicates a project was marked as completed
func (ProjectCompleted) ChangeType ¶
func (c ProjectCompleted) ChangeType() string
ChangeType returns "ProjectCompleted"
func (ProjectCompleted) EntityType ¶
func (p ProjectCompleted) EntityType() string
EntityType returns "Project" for all project changes
func (ProjectCompleted) EntityUUID ¶
func (p ProjectCompleted) EntityUUID() string
EntityUUID returns the UUID of the project
type ProjectCreated ¶
type ProjectCreated struct {
// contains filtered or unexported fields
}
ProjectCreated indicates a new project was created
func (ProjectCreated) ChangeType ¶
func (c ProjectCreated) ChangeType() string
ChangeType returns "ProjectCreated"
func (ProjectCreated) EntityType ¶
func (p ProjectCreated) EntityType() string
EntityType returns "Project" for all project changes
func (ProjectCreated) EntityUUID ¶
func (p ProjectCreated) EntityUUID() string
EntityUUID returns the UUID of the project
type ProjectDeleted ¶
type ProjectDeleted struct {
// contains filtered or unexported fields
}
ProjectDeleted indicates a project was permanently deleted
func (ProjectDeleted) ChangeType ¶
func (c ProjectDeleted) ChangeType() string
ChangeType returns "ProjectDeleted"
func (ProjectDeleted) EntityType ¶
func (p ProjectDeleted) EntityType() string
EntityType returns "Project" for all project changes
func (ProjectDeleted) EntityUUID ¶
func (p ProjectDeleted) EntityUUID() string
EntityUUID returns the UUID of the project
type ProjectRestored ¶
type ProjectRestored struct {
// contains filtered or unexported fields
}
ProjectRestored indicates a project was restored from trash
func (ProjectRestored) ChangeType ¶
func (c ProjectRestored) ChangeType() string
ChangeType returns "ProjectRestored"
func (ProjectRestored) EntityType ¶
func (p ProjectRestored) EntityType() string
EntityType returns "Project" for all project changes
func (ProjectRestored) EntityUUID ¶
func (p ProjectRestored) EntityUUID() string
EntityUUID returns the UUID of the project
type ProjectTitleChanged ¶
type ProjectTitleChanged struct {
OldTitle string
// contains filtered or unexported fields
}
ProjectTitleChanged indicates a project's title was modified
func (ProjectTitleChanged) ChangeType ¶
func (c ProjectTitleChanged) ChangeType() string
ChangeType returns "ProjectTitleChanged"
func (ProjectTitleChanged) EntityType ¶
func (p ProjectTitleChanged) EntityType() string
EntityType returns "Project" for all project changes
func (ProjectTitleChanged) EntityUUID ¶
func (p ProjectTitleChanged) EntityUUID() string
EntityUUID returns the UUID of the project
type ProjectTrashed ¶
type ProjectTrashed struct {
// contains filtered or unexported fields
}
ProjectTrashed indicates a project was moved to trash
func (ProjectTrashed) ChangeType ¶
func (c ProjectTrashed) ChangeType() string
ChangeType returns "ProjectTrashed"
func (ProjectTrashed) EntityType ¶
func (p ProjectTrashed) EntityType() string
EntityType returns "Project" for all project changes
func (ProjectTrashed) EntityUUID ¶
func (p ProjectTrashed) EntityUUID() string
EntityUUID returns the UUID of the project
type State ¶
type State struct {
// contains filtered or unexported fields
}
State provides read-only access to the synced Things state
func (*State) AllHeadings ¶
AllHeadings returns all headings.
func (*State) AllProjects ¶
AllProjects returns all projects
func (*State) ChecklistItems ¶
func (st *State) ChecklistItems(taskUUID string) ([]*things.CheckListItem, error)
ChecklistItems returns checklist items for a task
func (*State) HeadingsInProject ¶
HeadingsInProject returns headings belonging to a project.
func (*State) SearchTasks ¶
SearchTasks returns tasks whose title or note contains query.
func (*State) TasksInAnytime ¶
TasksInAnytime returns tasks in Anytime.
func (*State) TasksInArea ¶
TasksInArea returns tasks belonging to an area
func (*State) TasksInInbox ¶
TasksInInbox returns tasks in the Inbox
func (*State) TasksInProject ¶
TasksInProject returns tasks belonging to a project
func (*State) TasksInSomeday ¶
TasksInSomeday returns tasks in Someday.
func (*State) TasksInToday ¶
TasksInToday returns tasks scheduled for today
func (*State) TasksInUpcoming ¶
TasksInUpcoming returns tasks scheduled for future dates.
func (*State) TasksUnderHeading ¶
TasksUnderHeading returns tasks belonging to a heading.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer manages persistent sync with Things Cloud
func (*Syncer) ChangesForEntity ¶
ChangesForEntity returns all changes for a specific entity
func (*Syncer) ChangesSince ¶
ChangesSince returns changes that occurred after the given timestamp
func (*Syncer) ChangesSinceIndex ¶
ChangesSinceIndex returns changes that occurred after the given server index
func (*Syncer) LastSyncedIndex ¶
LastSyncedIndex returns the server index we've synced up to
func (*Syncer) QuickSync ¶
QuickSync fetches deltas from the persisted cursor without first querying the latest server index. It is useful for short-lived agents that already have a sync database and want the fewest cloud round trips.
type TagCreated ¶
type TagCreated struct {
// contains filtered or unexported fields
}
TagCreated indicates a new tag was created
func (TagCreated) ChangeType ¶
func (c TagCreated) ChangeType() string
ChangeType returns "TagCreated"
func (TagCreated) EntityType ¶
func (t TagCreated) EntityType() string
EntityType returns "Tag" for all tag changes
func (TagCreated) EntityUUID ¶
func (t TagCreated) EntityUUID() string
EntityUUID returns the UUID of the tag
type TagDeleted ¶
type TagDeleted struct {
// contains filtered or unexported fields
}
TagDeleted indicates a tag was permanently deleted
func (TagDeleted) ChangeType ¶
func (c TagDeleted) ChangeType() string
ChangeType returns "TagDeleted"
func (TagDeleted) EntityType ¶
func (t TagDeleted) EntityType() string
EntityType returns "Tag" for all tag changes
func (TagDeleted) EntityUUID ¶
func (t TagDeleted) EntityUUID() string
EntityUUID returns the UUID of the tag
type TagRenamed ¶
type TagRenamed struct {
OldTitle string
// contains filtered or unexported fields
}
TagRenamed indicates a tag's title was modified
func (TagRenamed) ChangeType ¶
func (c TagRenamed) ChangeType() string
ChangeType returns "TagRenamed"
func (TagRenamed) EntityType ¶
func (t TagRenamed) EntityType() string
EntityType returns "Tag" for all tag changes
func (TagRenamed) EntityUUID ¶
func (t TagRenamed) EntityUUID() string
EntityUUID returns the UUID of the tag
type TagShortcutChanged ¶
type TagShortcutChanged struct {
OldShortcut string
// contains filtered or unexported fields
}
TagShortcutChanged indicates a tag's keyboard shortcut was modified
func (TagShortcutChanged) ChangeType ¶
func (c TagShortcutChanged) ChangeType() string
ChangeType returns "TagShortcutChanged"
func (TagShortcutChanged) EntityType ¶
func (t TagShortcutChanged) EntityType() string
EntityType returns "Tag" for all tag changes
func (TagShortcutChanged) EntityUUID ¶
func (t TagShortcutChanged) EntityUUID() string
EntityUUID returns the UUID of the tag
type TaskAssignedToArea ¶
type TaskAssignedToArea struct {
Area *things.Area
OldArea *things.Area
// contains filtered or unexported fields
}
TaskAssignedToArea indicates a task was assigned to an area
func (TaskAssignedToArea) ChangeType ¶
func (c TaskAssignedToArea) ChangeType() string
ChangeType returns "TaskAssignedToArea"
func (TaskAssignedToArea) EntityType ¶
func (t TaskAssignedToArea) EntityType() string
EntityType returns "Task" for all task changes
func (TaskAssignedToArea) EntityUUID ¶
func (t TaskAssignedToArea) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskAssignedToProject ¶
type TaskAssignedToProject struct {
Project *things.Task
OldProject *things.Task
// contains filtered or unexported fields
}
TaskAssignedToProject indicates a task was assigned to a project
func (TaskAssignedToProject) ChangeType ¶
func (c TaskAssignedToProject) ChangeType() string
ChangeType returns "TaskAssignedToProject"
func (TaskAssignedToProject) EntityType ¶
func (t TaskAssignedToProject) EntityType() string
EntityType returns "Task" for all task changes
func (TaskAssignedToProject) EntityUUID ¶
func (t TaskAssignedToProject) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskCanceled ¶
type TaskCanceled struct {
// contains filtered or unexported fields
}
TaskCanceled indicates a task was canceled
func (TaskCanceled) ChangeType ¶
func (c TaskCanceled) ChangeType() string
ChangeType returns "TaskCanceled"
func (TaskCanceled) EntityType ¶
func (t TaskCanceled) EntityType() string
EntityType returns "Task" for all task changes
func (TaskCanceled) EntityUUID ¶
func (t TaskCanceled) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskCompleted ¶
type TaskCompleted struct {
// contains filtered or unexported fields
}
TaskCompleted indicates a task was marked as completed
func (TaskCompleted) ChangeType ¶
func (c TaskCompleted) ChangeType() string
ChangeType returns "TaskCompleted"
func (TaskCompleted) EntityType ¶
func (t TaskCompleted) EntityType() string
EntityType returns "Task" for all task changes
func (TaskCompleted) EntityUUID ¶
func (t TaskCompleted) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskCreated ¶
type TaskCreated struct {
// contains filtered or unexported fields
}
TaskCreated indicates a new task was created
func (TaskCreated) ChangeType ¶
func (c TaskCreated) ChangeType() string
ChangeType returns "TaskCreated"
func (TaskCreated) EntityType ¶
func (t TaskCreated) EntityType() string
EntityType returns "Task" for all task changes
func (TaskCreated) EntityUUID ¶
func (t TaskCreated) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskDeadlineChanged ¶
type TaskDeadlineChanged struct {
OldDeadline *time.Time
// contains filtered or unexported fields
}
TaskDeadlineChanged indicates a task's deadline was modified
func (TaskDeadlineChanged) ChangeType ¶
func (c TaskDeadlineChanged) ChangeType() string
ChangeType returns "TaskDeadlineChanged"
func (TaskDeadlineChanged) EntityType ¶
func (t TaskDeadlineChanged) EntityType() string
EntityType returns "Task" for all task changes
func (TaskDeadlineChanged) EntityUUID ¶
func (t TaskDeadlineChanged) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskDeleted ¶
type TaskDeleted struct {
// contains filtered or unexported fields
}
TaskDeleted indicates a task was permanently deleted
func (TaskDeleted) ChangeType ¶
func (c TaskDeleted) ChangeType() string
ChangeType returns "TaskDeleted"
func (TaskDeleted) EntityType ¶
func (t TaskDeleted) EntityType() string
EntityType returns "Task" for all task changes
func (TaskDeleted) EntityUUID ¶
func (t TaskDeleted) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskLocation ¶
type TaskLocation int
TaskLocation represents where a task is located in the Things UI
const ( LocationUnknown TaskLocation = iota LocationInbox LocationToday LocationAnytime LocationSomeday LocationUpcoming LocationProject )
func (TaskLocation) String ¶
func (l TaskLocation) String() string
String returns the string representation of TaskLocation
type TaskMovedToAnytime ¶
type TaskMovedToAnytime struct {
From TaskLocation
// contains filtered or unexported fields
}
TaskMovedToAnytime indicates a task was moved to Anytime
func (TaskMovedToAnytime) ChangeType ¶
func (c TaskMovedToAnytime) ChangeType() string
ChangeType returns "TaskMovedToAnytime"
func (TaskMovedToAnytime) EntityType ¶
func (t TaskMovedToAnytime) EntityType() string
EntityType returns "Task" for all task changes
func (TaskMovedToAnytime) EntityUUID ¶
func (t TaskMovedToAnytime) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskMovedToInbox ¶
type TaskMovedToInbox struct {
From TaskLocation
// contains filtered or unexported fields
}
TaskMovedToInbox indicates a task was moved to the Inbox
func (TaskMovedToInbox) ChangeType ¶
func (c TaskMovedToInbox) ChangeType() string
ChangeType returns "TaskMovedToInbox"
func (TaskMovedToInbox) EntityType ¶
func (t TaskMovedToInbox) EntityType() string
EntityType returns "Task" for all task changes
func (TaskMovedToInbox) EntityUUID ¶
func (t TaskMovedToInbox) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskMovedToSomeday ¶
type TaskMovedToSomeday struct {
From TaskLocation
// contains filtered or unexported fields
}
TaskMovedToSomeday indicates a task was moved to Someday
func (TaskMovedToSomeday) ChangeType ¶
func (c TaskMovedToSomeday) ChangeType() string
ChangeType returns "TaskMovedToSomeday"
func (TaskMovedToSomeday) EntityType ¶
func (t TaskMovedToSomeday) EntityType() string
EntityType returns "Task" for all task changes
func (TaskMovedToSomeday) EntityUUID ¶
func (t TaskMovedToSomeday) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskMovedToToday ¶
type TaskMovedToToday struct {
From TaskLocation
// contains filtered or unexported fields
}
TaskMovedToToday indicates a task was moved to Today
func (TaskMovedToToday) ChangeType ¶
func (c TaskMovedToToday) ChangeType() string
ChangeType returns "TaskMovedToToday"
func (TaskMovedToToday) EntityType ¶
func (t TaskMovedToToday) EntityType() string
EntityType returns "Task" for all task changes
func (TaskMovedToToday) EntityUUID ¶
func (t TaskMovedToToday) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskMovedToUpcoming ¶
type TaskMovedToUpcoming struct {
From TaskLocation
ScheduledFor time.Time
// contains filtered or unexported fields
}
TaskMovedToUpcoming indicates a task was scheduled for a future date
func (TaskMovedToUpcoming) ChangeType ¶
func (c TaskMovedToUpcoming) ChangeType() string
ChangeType returns "TaskMovedToUpcoming"
func (TaskMovedToUpcoming) EntityType ¶
func (t TaskMovedToUpcoming) EntityType() string
EntityType returns "Task" for all task changes
func (TaskMovedToUpcoming) EntityUUID ¶
func (t TaskMovedToUpcoming) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskNoteChanged ¶
type TaskNoteChanged struct {
OldNote string
// contains filtered or unexported fields
}
TaskNoteChanged indicates a task's note was modified
func (TaskNoteChanged) ChangeType ¶
func (c TaskNoteChanged) ChangeType() string
ChangeType returns "TaskNoteChanged"
func (TaskNoteChanged) EntityType ¶
func (t TaskNoteChanged) EntityType() string
EntityType returns "Task" for all task changes
func (TaskNoteChanged) EntityUUID ¶
func (t TaskNoteChanged) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskRestored ¶
type TaskRestored struct {
// contains filtered or unexported fields
}
TaskRestored indicates a task was restored from trash
func (TaskRestored) ChangeType ¶
func (c TaskRestored) ChangeType() string
ChangeType returns "TaskRestored"
func (TaskRestored) EntityType ¶
func (t TaskRestored) EntityType() string
EntityType returns "Task" for all task changes
func (TaskRestored) EntityUUID ¶
func (t TaskRestored) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskTagsChanged ¶
type TaskTagsChanged struct {
Added []string
Removed []string
// contains filtered or unexported fields
}
TaskTagsChanged indicates a task's tags were modified
func (TaskTagsChanged) ChangeType ¶
func (c TaskTagsChanged) ChangeType() string
ChangeType returns "TaskTagsChanged"
func (TaskTagsChanged) EntityType ¶
func (t TaskTagsChanged) EntityType() string
EntityType returns "Task" for all task changes
func (TaskTagsChanged) EntityUUID ¶
func (t TaskTagsChanged) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskTitleChanged ¶
type TaskTitleChanged struct {
OldTitle string
// contains filtered or unexported fields
}
TaskTitleChanged indicates a task's title was modified
func (TaskTitleChanged) ChangeType ¶
func (c TaskTitleChanged) ChangeType() string
ChangeType returns "TaskTitleChanged"
func (TaskTitleChanged) EntityType ¶
func (t TaskTitleChanged) EntityType() string
EntityType returns "Task" for all task changes
func (TaskTitleChanged) EntityUUID ¶
func (t TaskTitleChanged) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskTrashed ¶
type TaskTrashed struct {
// contains filtered or unexported fields
}
TaskTrashed indicates a task was moved to trash
func (TaskTrashed) ChangeType ¶
func (c TaskTrashed) ChangeType() string
ChangeType returns "TaskTrashed"
func (TaskTrashed) EntityType ¶
func (t TaskTrashed) EntityType() string
EntityType returns "Task" for all task changes
func (TaskTrashed) EntityUUID ¶
func (t TaskTrashed) EntityUUID() string
EntityUUID returns the UUID of the task
type TaskUncompleted ¶
type TaskUncompleted struct {
// contains filtered or unexported fields
}
TaskUncompleted indicates a completed task was marked as incomplete
func (TaskUncompleted) ChangeType ¶
func (c TaskUncompleted) ChangeType() string
ChangeType returns "TaskUncompleted"
func (TaskUncompleted) EntityType ¶
func (t TaskUncompleted) EntityType() string
EntityType returns "Task" for all task changes
func (TaskUncompleted) EntityUUID ¶
func (t TaskUncompleted) EntityUUID() string
EntityUUID returns the UUID of the task
type UnknownChange ¶
type UnknownChange struct {
Details string
// contains filtered or unexported fields
}
UnknownChange represents a change that could not be categorized
func (UnknownChange) ChangeType ¶
func (c UnknownChange) ChangeType() string
ChangeType returns "UnknownChange"
func (UnknownChange) EntityType ¶
func (c UnknownChange) EntityType() string
EntityType returns the entity type string
func (UnknownChange) EntityUUID ¶
func (c UnknownChange) EntityUUID() string
EntityUUID returns the entity UUID
func (UnknownChange) ServerIndex ¶
func (b UnknownChange) ServerIndex() int
ServerIndex returns the server index at which this change occurred