sync

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: MIT Imports: 7 Imported by: 0

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))
}

Index

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

type ChecklistItemCompleted struct {
	Task *things.Task
	// contains filtered or unexported fields
}

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

type ChecklistItemCreated struct {
	Task *things.Task
	// contains filtered or unexported fields
}

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

type HeadingCreated struct {
	Project *things.Task
	// contains filtered or unexported fields
}

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

func (LoggedChange) Timestamp

func (b LoggedChange) Timestamp() time.Time

Timestamp returns when this change was synced

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 QueryOpts

type QueryOpts struct {
	IncludeCompleted bool
	IncludeTrashed   bool
}

QueryOpts controls filtering for state queries

type State

type State struct {
	// contains filtered or unexported fields
}

State provides read-only access to the synced Things state

func (*State) AllAreas

func (st *State) AllAreas() ([]*things.Area, error)

AllAreas returns all areas

func (*State) AllHeadings

func (st *State) AllHeadings(opts QueryOpts) ([]*things.Task, error)

AllHeadings returns all headings.

func (*State) AllProjects

func (st *State) AllProjects(opts QueryOpts) ([]*things.Task, error)

AllProjects returns all projects

func (*State) AllTags

func (st *State) AllTags() ([]*things.Tag, error)

AllTags returns all tags

func (*State) AllTasks

func (st *State) AllTasks(opts QueryOpts) ([]*things.Task, error)

AllTasks returns all tasks matching the query options

func (*State) Area

func (st *State) Area(uuid string) (*things.Area, error)

Area retrieves an area by UUID

func (*State) ChecklistItems

func (st *State) ChecklistItems(taskUUID string) ([]*things.CheckListItem, error)

ChecklistItems returns checklist items for a task

func (*State) HeadingsInProject

func (st *State) HeadingsInProject(projectUUID string, opts QueryOpts) ([]*things.Task, error)

HeadingsInProject returns headings belonging to a project.

func (*State) SearchTasks

func (st *State) SearchTasks(query string, opts QueryOpts) ([]*things.Task, error)

SearchTasks returns tasks whose title or note contains query.

func (*State) Tag

func (st *State) Tag(uuid string) (*things.Tag, error)

Tag retrieves a tag by UUID

func (*State) Task

func (st *State) Task(uuid string) (*things.Task, error)

Task retrieves a task by UUID

func (*State) TasksInAnytime

func (st *State) TasksInAnytime(opts QueryOpts) ([]*things.Task, error)

TasksInAnytime returns tasks in Anytime.

func (*State) TasksInArea

func (st *State) TasksInArea(areaUUID string, opts QueryOpts) ([]*things.Task, error)

TasksInArea returns tasks belonging to an area

func (*State) TasksInInbox

func (st *State) TasksInInbox(opts QueryOpts) ([]*things.Task, error)

TasksInInbox returns tasks in the Inbox

func (*State) TasksInProject

func (st *State) TasksInProject(projectUUID string, opts QueryOpts) ([]*things.Task, error)

TasksInProject returns tasks belonging to a project

func (*State) TasksInSomeday

func (st *State) TasksInSomeday(opts QueryOpts) ([]*things.Task, error)

TasksInSomeday returns tasks in Someday.

func (*State) TasksInToday

func (st *State) TasksInToday(opts QueryOpts) ([]*things.Task, error)

TasksInToday returns tasks scheduled for today

func (*State) TasksInUpcoming

func (st *State) TasksInUpcoming(opts QueryOpts) ([]*things.Task, error)

TasksInUpcoming returns tasks scheduled for future dates.

func (*State) TasksUnderHeading

func (st *State) TasksUnderHeading(headingUUID string, opts QueryOpts) ([]*things.Task, error)

TasksUnderHeading returns tasks belonging to a heading.

func (*State) TasksWithTag

func (st *State) TasksWithTag(tagUUID string, opts QueryOpts) ([]*things.Task, error)

TasksWithTag returns tasks tagged with the given tag UUID.

type Syncer

type Syncer struct {
	// contains filtered or unexported fields
}

Syncer manages persistent sync with Things Cloud

func Open

func Open(dbPath string, client *things.Client) (*Syncer, error)

Open creates or opens a sync database and connects to Things Cloud

func (*Syncer) ChangesForEntity

func (s *Syncer) ChangesForEntity(entityUUID string) ([]Change, error)

ChangesForEntity returns all changes for a specific entity

func (*Syncer) ChangesSince

func (s *Syncer) ChangesSince(timestamp time.Time) ([]Change, error)

ChangesSince returns changes that occurred after the given timestamp

func (*Syncer) ChangesSinceIndex

func (s *Syncer) ChangesSinceIndex(serverIndex int) ([]Change, error)

ChangesSinceIndex returns changes that occurred after the given server index

func (*Syncer) Close

func (s *Syncer) Close() error

Close closes the database connection

func (*Syncer) LastSyncedIndex

func (s *Syncer) LastSyncedIndex() int

LastSyncedIndex returns the server index we've synced up to

func (*Syncer) QuickSync

func (s *Syncer) QuickSync() ([]Change, error)

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.

func (*Syncer) State

func (s *Syncer) State() *State

State returns a read-only view of the current aggregated state

func (*Syncer) Sync

func (s *Syncer) Sync() ([]Change, error)

Sync fetches new items from Things Cloud, updates local state, and returns the list of changes in order

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

func (UnknownChange) Timestamp

func (b UnknownChange) Timestamp() time.Time

Timestamp returns when this change was synced

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL