Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyPatches(original string, patches []NotePatch) string
- func ApplyPatchesChecked(original string, patches []NotePatch) (string, error)
- func DecodeUUID(s string) (uuid.UUID, error)
- func EncodeLegacyIdentifier(legacyID string) string
- func EncodeUUID(u uuid.UUID) string
- func NewUUID() string
- func String(str string) *string
- func ValidateTaskReadKinds(items []Item) error
- func ValidateUUID(s string) error
- type AccountService
- type AccountStatus
- type AppInstanceRequest
- type Area
- type AreaActionItem
- type AreaActionItemPayload
- type Boolean
- type CheckListActionItem
- type CheckListActionItemPayload
- type CheckListItem
- type Client
- func (c *Client) CreateHistory() (*History, error)
- func (c *Client) Histories() ([]*History, error)
- func (c *Client) History(id string) (*History, error)
- func (c *Client) HistoryWithID(id string) *History
- func (c *Client) OwnHistory() (*History, error)
- func (c *Client) RegisterAppInstance(req AppInstanceRequest) error
- func (c *Client) Verify() (*VerifyResponse, error)
- type ClientInfo
- type FrequencyUnit
- type HTTPError
- type History
- type Identifiable
- type Item
- type ItemAction
- type ItemKind
- type ItemsOptions
- type Note
- type NotePatch
- type RepeaterConfiguration
- type RepeaterDetailConfiguration
- type Setting
- type Tag
- type TagActionItem
- type TagActionItemPayload
- type Task
- type TaskActionItem
- type TaskActionItemPayload
- type TaskReadPayload
- type TaskSchedule
- type TaskStatus
- type TaskType
- type Timestamp
- type TombstoneActionItem
- type TombstoneActionItemPayload
- type UnsupportedTaskKindError
- type VerifyResponse
Examples ¶
Constants ¶
const (
// APIEndpoint is the public culturedcode https endpoint
APIEndpoint = "https://cloud.culturedcode.com"
)
const NoteTypeDelta = 2
NoteTypeDelta indicates a note with incremental patches
const NoteTypeFullText = 1
NoteTypeFullText indicates a note with complete text
const TaskReplayVersion = 3
TaskReplayVersion identifies the task read semantics used to build derived state. Cached state from older generations must be replayed from scratch.
const ThingsUserAgent = "ThingsMac/32209501"
ThingsUserAgent is the http user-agent header set by things for mac
Variables ¶
var ( ErrUnauthorized = errors.New("unauthorized") )
Functions ¶
func ApplyPatches ¶ added in v0.3.0
ApplyPatches applies a series of text patches using UTF-8 byte offsets.
func ApplyPatchesChecked ¶ added in v0.6.0
ApplyPatchesChecked applies byte-offset patches and rejects any patch that leaves the note in an invalid UTF-8 state. ApplyPatches remains available for callers that rely on its historical unchecked behavior.
func DecodeUUID ¶ added in v0.3.0
DecodeUUID decodes a canonical Base58 identifier back into a UUID. It rejects strings that are not canonical encodings of exactly 16 bytes.
func EncodeLegacyIdentifier ¶ added in v0.5.0
EncodeLegacyIdentifier derives the current Base58 identifier for an object created before Things Cloud's identifier migration. Old history items (Task3, Task4, Area2, ...) key objects by identifier strings such as uppercase UUIDs; newer items (Task6, ...) key the same objects by
Base58(SHA1(legacyID)[:16])
The history contains no records linking the two generations; this derivation is the only link. legacyID must be the identifier text exactly as stored in the history: hashing is byte-exact, so any normalization (such as lowercasing a UUID) yields a different identifier. SHA-1 mirrors the derivation Things itself performs; it is not a security primitive here.
Recurring-task instances use composite identifiers of the form <uuid>-YYYYMMDD and hash in two steps: first the <uuid> prefix alone, then its raw 16-byte digest followed by the "-YYYYMMDD" text.
The empty string is returned unchanged: a malformed item should keep an obviously-bogus key rather than gain a plausible-looking derived one.
func EncodeUUID ¶ added in v0.3.0
EncodeUUID encodes a UUID as canonical Base58: one leading '1' per leading zero byte, matching the identifiers Things.app itself emits.
func NewUUID ¶ added in v0.3.0
func NewUUID() string
NewUUID returns a new random identifier in the canonical Base58 wire format expected by Things Cloud.
func ValidateTaskReadKinds ¶ added in v0.6.0
ValidateTaskReadKinds preflights an entire batch before any task state is mutated. Unrelated unknown entities retain their existing handling.
func ValidateUUID ¶ added in v0.3.0
ValidateUUID reports whether s is a canonical Base58-encoded 16-byte identifier safe to write to Things Cloud.
Types ¶
type AccountService ¶
type AccountService service
AccountService allows account specific interaction with thingscloud
func (*AccountService) AcceptSLA ¶ added in v0.3.0
func (s *AccountService) AcceptSLA() error
func (*AccountService) ChangePassword ¶
func (s *AccountService) ChangePassword(newPassword string) (*Client, error)
ChangePassword allows you to change your account password. Because things does not work with sessions you need to create a new client instance after executing this method
func (*AccountService) Confirm ¶
func (s *AccountService) Confirm(code string) error
Confirm finishes the account creation by providing the email token send by thingscloud
func (*AccountService) Delete ¶
func (s *AccountService) Delete() error
Delete deletes your current thingscloud account. This cannot be reversed
type AccountStatus ¶
type AccountStatus string
AccountStatus describes possible thingscloud account statuses
const ( // AccountStatusActive is for active accounts AccountStatusActive AccountStatus = "SYAccountStatusActive" )
type AppInstanceRequest ¶ added in v0.3.0
type AppInstanceRequest struct {
AppInstanceID string `json:"-"`
HistoryKey string `json:"history-key"`
APNSToken string `json:"apns-token"`
AppID string `json:"app-id"`
Dev bool `json:"dev"`
}
AppInstanceRequest describes the payload for registering a device for push notifications
type Area ¶
Area describes an Area inside things. An Area is a container for tasks 0|uuid|TEXT|0||1 1|title|TEXT|0||0 2|visible|INTEGER|0||0 3|index|INTEGER|0||0
type AreaActionItem ¶
type AreaActionItem struct {
Item
P AreaActionItemPayload `json:"p"`
}
AreaActionItem describes an event on an Area
func (AreaActionItem) UUID ¶
func (item AreaActionItem) UUID() string
UUID returns the UUID of the modified Area
type AreaActionItemPayload ¶
type AreaActionItemPayload struct {
IX *int `json:"ix,omitempty"`
Title *string `json:"tt,omitempty"`
TagIDs []string `json:"tg,omitempty"`
}
AreaActionItemPayload describes the payload for modifying Areas
type Boolean ¶
type Boolean bool
Boolean allows integers to be parsed into booleans, where 1 means true and 0 means false
func (*Boolean) MarshalJSON ¶
MarshalJSON takes a boolean and serializes it as an integer
func (*Boolean) UnmarshalJSON ¶
UnmarshalJSON takes an int and creates a boolean instance
type CheckListActionItem ¶
type CheckListActionItem struct {
Item
P CheckListActionItemPayload `json:"p"`
}
CheckListActionItem describes an event on a check list item
func (CheckListActionItem) UUID ¶
func (item CheckListActionItem) UUID() string
UUID returns the UUID of the modified CheckListItem
type CheckListActionItemPayload ¶
type CheckListActionItemPayload struct {
CreationDate *Timestamp `json:"cd,omitempty"`
ModificationDate *Timestamp `json:"md,omitempty"`
Index *int `json:"ix"`
Status *TaskStatus `json:"ss,omitempty"`
Title *string `json:"tt,omitempty"`
CompletionDate *Timestamp `json:"sp,omitempty"`
TaskIDs *[]string `json:"ts,omitempty"`
Leavable *bool `json:"lt,omitempty"`
ExtensionData json.RawMessage `json:"xx,omitempty"`
}
CheckListActionItemPayload describes the payload for modifying CheckListItems
type CheckListItem ¶
type CheckListItem struct {
UUID string
CreationDate time.Time
ModificationDate *time.Time
Status TaskStatus
Title string
Index int
CompletionDate *time.Time
TaskIDs []string
}
CheckListItem describes a check list item 0|uuid|TEXT|0||1 1|userModificationDate|REAL|0||0 2|creationDate|REAL|0||0 3|title|TEXT|0||0 4|status|INTEGER|0||0 5|stopDate|REAL|0||0 6|index|INTEGER|0||0 7|task|TEXT|0||0
type Client ¶
type Client struct {
Endpoint string
EMail string
ClientInfo ClientInfo
Debug bool
Accounts *AccountService
// contains filtered or unexported fields
}
Client is a culturedcode cloud client. It can be used to interact with the things cloud to manage your data.
func (*Client) CreateHistory ¶
CreateHistory requests a new history key
func (*Client) Histories ¶
Histories requests all known history keys
Example ¶
client := New(APIEndpoint, os.Getenv("THINGS_USERNAME"), os.Getenv("THINGS_PASSWORD"))
histories, err := client.Histories()
if err != nil {
log.Printf("Failed loading histories: %q", err.Error())
}
for _, history := range histories {
if err := history.Sync(); err != nil {
log.Printf("Failed syncing history: %q", err.Error())
}
}
func (*Client) HistoryWithID ¶ added in v0.3.0
HistoryWithID creates a History object with the given ID without making a network call. Use this when you already know the history ID (e.g., from a previous sync).
func (*Client) OwnHistory ¶ added in v0.3.0
OwnHistory returns the clients own history
func (*Client) RegisterAppInstance ¶ added in v0.3.0
func (c *Client) RegisterAppInstance(req AppInstanceRequest) error
RegisterAppInstance registers a device for push notifications via APNS
func (*Client) Verify ¶
func (c *Client) Verify() (*VerifyResponse, error)
Verify checks that the provided API credentials are valid.
Example ¶
client := New(APIEndpoint, os.Getenv("THINGS_USERNAME"), os.Getenv("THINGS_PASSWORD"))
_, err := client.Verify()
if err != nil {
log.Printf("Invalid Credentials: %q", err.Error())
}
type ClientInfo ¶ added in v0.3.0
type ClientInfo struct {
DeviceModel string `json:"dm"`
LocalRegion string `json:"lr"`
NF bool `json:"nf"`
NK bool `json:"nk"`
AppName string `json:"nn"`
AppVersion string `json:"nv"`
OSName string `json:"on"`
OSVersion string `json:"ov"`
PrimaryLang string `json:"pl"`
UserLocale string `json:"ul"`
}
ClientInfo represents the device metadata sent in the things-client-info header.
func DefaultClientInfo ¶ added in v0.3.0
func DefaultClientInfo() ClientInfo
DefaultClientInfo returns a ClientInfo with default values matching a typical Mac client.
type FrequencyUnit ¶ added in v0.1.1
type FrequencyUnit int64
FrequencyUnit describes recurring frequencies
var ( // FrequencyUnitDaily occurs every n days FrequencyUnitDaily FrequencyUnit = 16 // FrequencyUnitWeekly occurs every n weeks FrequencyUnitWeekly FrequencyUnit = 256 // FrequencyUnitMonthly occurs every n months FrequencyUnitMonthly FrequencyUnit = 8 // FrequencyUnitYearly occurs every n years FrequencyUnitYearly FrequencyUnit = 4 )
type HTTPError ¶ added in v0.3.0
HTTPError is returned when the Things Cloud server responds with an unexpected status code. Callers can inspect StatusCode with errors.As to decide whether a request is worth retrying.
type History ¶
type History struct {
ID string
Client *Client
LatestServerIndex int
LoadedServerIndex int
LatestSchemaVersion int
EndTotalContentSize int
LatestTotalContentSize int
}
History represents a synchronization stream. It's identified with a uuid v4
func (*History) Delete ¶
Delete destroys a history Note that thingscloud will always return 202, even if the key is unknown
func (*History) Items ¶
func (h *History) Items(opts ItemsOptions) ([]Item, bool, error)
Items fetches changes from thingscloud. Every change contains multiple items which have been modified. The Items method unwraps these objects and returns a list instead.
Note that if a item was changed multiple times it will be present multiple times in the result too.
Example ¶
client := New(APIEndpoint, os.Getenv("THINGS_USERNAME"), os.Getenv("THINGS_PASSWORD"))
histories, err := client.Histories()
if err != nil {
log.Printf("Failed loading histories: %q", err.Error())
}
history := histories[0]
items, _, err := history.Items(ItemsOptions{})
if err != nil {
log.Printf("Failed loading items: %q", err.Error())
}
log.Printf("got %d items.", len(items))
func (*History) Write ¶
func (h *History) Write(items ...Identifiable) error
type Identifiable ¶
type Identifiable interface {
UUID() string
}
Identifiable abstracts different thingscloud write requests. As we need to provide a map indexed by UUID, all we care about is the ID of the change, not the change itself
type Item ¶
type Item struct {
UUID string `json:"-"`
P json.RawMessage `json:"p"`
Kind ItemKind `json:"e"`
Action ItemAction `json:"t"`
ServerIndex int `json:"-"`
HasServerIndex bool `json:"-"`
}
Item is an event in thingscloud. Every action inside things generates an Item. Common items are the creation of a task, area or checklist, as well as modifying attributes or marking things as done.
type ItemAction ¶
type ItemAction int
ItemAction describes possible actions on Items
const ( // ItemActionCreated is used to indicate a new Item was created ItemActionCreated ItemAction = iota // ItemActionModified is used to indicate an existing Item was modified ItemActionModified ItemAction = 1 // ItemActionDeleted is used as a tombstone for an Item ItemActionDeleted ItemAction = 2 )
func (ItemAction) String ¶
func (i ItemAction) String() string
type ItemKind ¶
type ItemKind string
ItemKind describes the different types things cloud supports
var ( // ItemKindChecklistItem identifies a CheckList ItemKindChecklistItem ItemKind = "ChecklistItem" ItemKindChecklistItem2 ItemKind = "ChecklistItem2" ItemKindChecklistItem3 ItemKind = "ChecklistItem3" // ItemKindTask identifies a Task or Subtask ItemKindTask ItemKind = "Task6" // ItemKindTask7 identifies the explicitly validated Task7 read/write scope. // ItemKindTask remains Task6 for compatibility with existing callers. ItemKindTask7 ItemKind = "Task7" ItemKindTask4 ItemKind = "Task4" ItemKindTask3 ItemKind = "Task3" ItemKindTaskPlain ItemKind = "Task" // ItemKindArea identifies an Area in the legacy Area2 encoding. // // Deprecated: never WRITE items with this kind — Things.app silently // ignores Area2 creates and manufactures a duplicate area with a new // UUID. Use ItemKindArea3. Reading Area2 items from old histories is // still supported. ItemKindArea ItemKind = "Area2" ItemKindArea3 ItemKind = "Area3" ItemKindAreaPlain ItemKind = "Area" // ItemKindSettings identifies a setting ItemKindSettings ItemKind = "Settings3" // ItemKindTag identifies a Tag ItemKindTag ItemKind = "Tag3" ItemKindTag4 ItemKind = "Tag4" ItemKindTagPlain ItemKind = "Tag" ItemKindTombstone ItemKind = "Tombstone2" ItemKindTombstonePlain ItemKind = "Tombstone" )
type ItemsOptions ¶
type ItemsOptions struct {
StartIndex int
}
ItemsOptions allows a client to pickup changes from a specific index
type Note ¶ added in v0.3.0
type Note struct {
TypeTag string `json:"_t"`
Type int `json:"t"`
Checksum int64 `json:"ch,omitempty"`
Value string `json:"v,omitempty"`
Patches []NotePatch `json:"ps,omitempty"`
}
Note describes a structured note as used by the Things API
type NotePatch ¶ added in v0.3.0
type NotePatch struct {
Replacement string `json:"r"`
Position int `json:"p"`
Length int `json:"l"`
Checksum int64 `json:"ch"`
}
NotePatch describes a single text replacement operation
type RepeaterConfiguration ¶ added in v0.1.1
type RepeaterConfiguration struct {
FirstScheduledAt *Timestamp `json:"ia,omitempty"`
RepeatCount *int64 `json:"rc,omitempty"`
FrequencyUnit FrequencyUnit `json:"fu"`
FrequencyAmplitude int64 `json:"fa"`
DetailConfiguration []RepeaterDetailConfiguration `json:"of"`
LastScheduledAt *Timestamp `json:"ed,omitempty"`
Version int `json:"rrv,omitempty"`
Type int `json:"tp,omitempty"`
TimeShift int `json:"ts,omitempty"`
StartReference *Timestamp `json:"sr,omitempty"`
}
RepeaterConfiguration configures the recurring rules of a task/ project
func (RepeaterConfiguration) ComputeFirstScheduledAt ¶ added in v0.1.1
func (c RepeaterConfiguration) ComputeFirstScheduledAt(t time.Time) time.Time
ComputeFirstScheduledAt calculates the first occurrence of a recurring rule based on the pattern This value has to be stored as FirstScheduledAt per thingscloud convention
func (RepeaterConfiguration) IsNeverending ¶ added in v0.1.1
func (c RepeaterConfiguration) IsNeverending() bool
IsNeverending determines if a recurring rule has a specific end
func (RepeaterConfiguration) NextScheduledAt ¶ added in v0.1.1
func (c RepeaterConfiguration) NextScheduledAt(repeat int) time.Time
NextScheduledAt returns the next Nth date a rule should occur. Note that things generates these ToDos as necessary.
type RepeaterDetailConfiguration ¶ added in v0.1.1
type RepeaterDetailConfiguration struct {
Day *int64 `json:"dy,omitempty"`
Month *int64 `json:"mo,omitempty"`
Weekday *time.Weekday `json:"wd,omitempty"`
MonthOf *int64 `json:"wdo,omitempty"`
}
RepeaterDetailConfiguration configures specifics of a repeater configuration.
type Setting ¶
type Setting struct{}
Setting describes things settings 0|uuid|TEXT|0||1 1|logInterval|INTEGER|0||0 2|manualLogDate|REAL|0||0 3|groupTodayByParent|INTEGER|0||0
type Tag ¶
Tag describes the aggregated state of an Tag 0|uuid|TEXT|0||1 1|title|TEXT|0||0 2|shortcut|TEXT|0||0 3|usedDate|REAL|0||0 4|parent|TEXT|0||0 5|index|INTEGER|0||0
type TagActionItem ¶
type TagActionItem struct {
Item
P TagActionItemPayload `json:"p"`
}
TagActionItem describes an event on a tag
func (TagActionItem) UUID ¶
func (t TagActionItem) UUID() string
UUID returns the UUID of the modified Tag
type TagActionItemPayload ¶
type TagActionItemPayload struct {
IX *int `json:"ix"`
Title *string `json:"tt"`
ShortHand *string `json:"sh"`
ParentTagIDs *[]string `json:"pn"`
ExtensionData json.RawMessage `json:"xx,omitempty"`
}
TagActionItemPayload describes the payload for modifying Areas
type Task ¶
type Task struct {
UUID string
CreationDate time.Time
ModificationDate *time.Time
Status TaskStatus
Title string
Note string
ScheduledDate *time.Time
CompletionDate *time.Time
DeadlineDate *time.Time
Index int
AreaIDs []string
ParentTaskIDs []string
ActionGroupIDs []string
InTrash bool
Schedule TaskSchedule
Type TaskType
TodayIndex int
DueOrder int
AlarmTimeOffset *int
TagIDs []string
RecurrenceIDs []string
DelegateIDs []string
}
Task describes a Task inside things. 0|uuid|TEXT|0||1 1|userModificationDate|REAL|0||0 2|creationDate|REAL|0||0 3|trashed|INTEGER|0||0 4|type|INTEGER|0||0 5|title|TEXT|0||0 6|notes|TEXT|0||0 7|dueDate|REAL|0||0 8|dueDateOffset|INTEGER|0||0 9|status|INTEGER|0||0 10|stopDate|REAL|0||0 11|start|INTEGER|0||0 12|startDate|REAL|0||0 13|index|INTEGER|0||0 14|todayIndex|INTEGER|0||0 15|area|TEXT|0||0 16|project|TEXT|0||0 17|repeatingTemplate|TEXT|0||0 18|delegate|TEXT|0||0 19|recurrenceRule|BLOB|0||0 20|instanceCreationStartDate|REAL|0||0 21|instanceCreationPaused|INTEGER|0||0 22|instanceCreationCount|INTEGER|0||0 23|afterCompletionReferenceDate|REAL|0||0 24|actionGroup|TEXT|0||0 25|untrashedLeafActionsCount|INTEGER|0||0 26|openUntrashedLeafActionsCount|INTEGER|0||0 27|checklistItemsCount|INTEGER|0||0 28|openChecklistItemsCount|INTEGER|0||0 29|startBucket|INTEGER|0||0 30|alarmTimeOffset|REAL|0||0 31|lastAlarmInteractionDate|REAL|0||0 32|todayIndexReferenceDate|REAL|0||0 33|nextInstanceStartDate|REAL|0||0 34|dueDateSuppressionDate|REAL|0||0
type TaskActionItem ¶
type TaskActionItem struct {
Item
P TaskActionItemPayload `json:"p"`
}
TaskActionItem describes an event on a Task
func (TaskActionItem) UUID ¶
func (t TaskActionItem) UUID() string
UUID returns the UUID of the modified Task
type TaskActionItemPayload ¶
type TaskActionItemPayload struct {
Index *int `json:"ix,omitempty"`
CreationDate *Timestamp `json:"cd,omitempty"`
ModificationDate *Timestamp `json:"md,omitempty"` // ok
ScheduledDate *Timestamp `json:"sr,omitempty"`
CompletionDate *Timestamp `json:"sp,omitempty"`
DeadlineDate *Timestamp `json:"dd,omitempty"` //
TaskIR *Timestamp `json:"tir,omitempty"` // hm, not sure what tir stands for
Status *TaskStatus `json:"ss,omitempty"`
Type *TaskType `json:"tp,omitempty"`
Title *string `json:"tt,omitempty"`
Note json.RawMessage `json:"nt,omitempty"`
AreaIDs *[]string `json:"ar,omitempty"`
ParentTaskIDs *[]string `json:"pr,omitempty"`
TagIDs []string `json:"tg,omitempty"`
InTrash *bool `json:"tr,omitempty"`
TaskIndex *int `json:"ti,omitempty"`
RecurrenceTaskIDs *[]string `json:"rt,omitempty"`
Schedule *TaskSchedule `json:"st,omitempty"`
ActionGroupIDs *[]string `json:"agr,omitempty"`
Repeater *RepeaterConfiguration `json:"rr,omitempty"`
DueOrder *int `json:"do,omitempty"`
Leavable *bool `json:"lt,omitempty"`
IsCompletedByChildren *bool `json:"icp,omitempty"`
IsCompletedCount *int `json:"icc,omitempty"`
InstanceCreationStartDate *Timestamp `json:"icsd,omitempty"`
SubtaskBehavior *int `json:"sb,omitempty"`
DelegateIDs *[]string `json:"dl,omitempty"`
LastActionItemID *Timestamp `json:"lai,omitempty"`
ReminderDate *Timestamp `json:"rmd,omitempty"` // legacy API name: repeater migration date, not a reminder
AlarmTimeOffset *int `json:"ato,omitempty"`
ActionRequiredDate *Timestamp `json:"acrd,omitempty"`
DeadlineSuppression *Timestamp `json:"dds,omitempty"`
ExtensionData json.RawMessage `json:"xx,omitempty"`
}
TaskActionItemPayload describes the payload for modifying Tasks, and also Projects, as projects are special kind of Tasks
type TaskReadPayload ¶ added in v0.6.0
type TaskReadPayload struct {
TaskActionItemPayload
// contains filtered or unexported fields
}
TaskReadPayload adds explicit-null tracking to the existing wire payload without changing its write representation. Unknown properties remain available in the original Item.P; this helper interprets supported fields.
func DecodeTaskReadPayload ¶ added in v0.6.0
func DecodeTaskReadPayload(raw json.RawMessage) (TaskReadPayload, error)
DecodeTaskReadPayload distinguishes an omitted property (preserve existing state) from an explicit null (clear a nullable property).
func (TaskReadPayload) ApplyNulls ¶ added in v0.6.0
func (p TaskReadPayload) ApplyNulls(task *Task)
ApplyNulls clears nullable fields after the ordinary non-nil payload fields have been applied. In particular, tir is a reference date and never changes ScheduledDate; only sr controls that field.
func (TaskReadPayload) ResolveNote ¶ added in v0.6.0
func (p TaskReadPayload) ResolveNote(current string) (string, error)
ResolveNote applies the note field to current using the read protocol's plain-text, full-text, delta, and explicit-null semantics.
type TaskSchedule ¶
type TaskSchedule int
TaskSchedule describes when a task is scheduled
const ( // TaskScheduleInbox indicates unprocessed tasks in the Inbox (st=0) TaskScheduleInbox TaskSchedule = 0 // TaskScheduleAnytime indicates started tasks; displayed in Today when sr/tir // are set to today's date, or in Anytime when sr/tir are null (st=1) TaskScheduleAnytime TaskSchedule = 1 // TaskScheduleSomeday indicates deferred tasks; displayed in Upcoming when // sr/tir have a future date, or in Someday when sr/tir are null (st=2) TaskScheduleSomeday TaskSchedule = 2 // TaskScheduleToday is deprecated: use TaskScheduleAnytime with sr/tir dates. // The "st" field value 0 actually means Inbox, not Today. // Kept for backward compatibility. TaskScheduleToday = TaskScheduleInbox )
func Schedule ¶ added in v0.3.0
func Schedule(val TaskSchedule) *TaskSchedule
Schedule returns a pointer to a TaskSchedule
func (TaskSchedule) String ¶
func (i TaskSchedule) String() string
type TaskStatus ¶
type TaskStatus int
TaskStatus describes if a thing is completed or not
const ( // TaskStatusPending indicates a new task TaskStatusPending TaskStatus = iota // TaskStatusCompleted indicates a completed task TaskStatusCompleted TaskStatus = 3 // TaskStatusCanceled indicates a canceled task TaskStatusCanceled TaskStatus = 2 )
func Status ¶ added in v0.3.0
func Status(val TaskStatus) *TaskStatus
Status returns a pointer to a TaskStatus
func (TaskStatus) String ¶
func (i TaskStatus) String() string
type TaskType ¶ added in v0.3.0
type TaskType int
TaskType describes the type of a task entity
func TaskTypePtr ¶ added in v0.3.0
TaskTypePtr returns a pointer to a TaskType
type Timestamp ¶
Timestamp allows unix epochs represented as float or ints to be unmarshalled into time.Time objects
func Time ¶ added in v0.3.0
Time returns a pointer to a Time. The zero time returns nil: its UnixNano is out of range and would marshal to a garbage 1754 date.
func (*Timestamp) Format ¶
Format returns a textual representation of the time value formatted according to layout
func (*Timestamp) MarshalJSON ¶
MarshalJSON converts a timestamp into a fractional unix epoch (seconds with sub-second precision), matching the format used by the Things Cloud API (e.g. 1770713623.4716659).
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON takes a unix epoch from float/ int and creates a time.Time instance, preserving sub-second precision.
type TombstoneActionItem ¶ added in v0.3.0
type TombstoneActionItem struct {
Item
P TombstoneActionItemPayload `json:"p"`
}
TombstoneActionItem describes a tombstone deletion event
func (TombstoneActionItem) UUID ¶ added in v0.3.0
func (t TombstoneActionItem) UUID() string
UUID returns the UUID of the TombstoneActionItem
type TombstoneActionItemPayload ¶ added in v0.3.0
type TombstoneActionItemPayload struct {
DeletedObjectID string `json:"dloid"`
DeletionDate float64 `json:"dld"`
}
TombstoneActionItemPayload describes the payload for tombstone deletion records
type UnsupportedTaskKindError ¶ added in v0.6.0
UnsupportedTaskKindError means the task state would be incomplete if replay continued. ServerIndex is -1 when the source did not provide an index.
func (*UnsupportedTaskKindError) Error ¶ added in v0.6.0
func (e *UnsupportedTaskKindError) Error() string
type VerifyResponse ¶
type VerifyResponse struct {
SLAVersionAccepted string `json:"SLA-version-accepted"`
Issues json.RawMessage `json:"issues"`
Email string `json:"email"`
MaildropEmail string `json:"maildrop-email"`
Status AccountStatus `json:"status"`
HistoryKey string `json:"history-key"`
}
VerifyResponse contains details about your account
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
debug
command
|
|
|
debugupdate
command
|
|
|
findtask
command
|
|
|
fullstate
command
|
|
|
list
command
|
|
|
rawitem
command
|
|
|
rawtask
command
|
|
|
recent
command
|
|
|
soak
command
Command soak stress-tests the write path against a REAL Things Cloud account by driving the things-cli binary through many create/edit/move/ complete/trash cycles, including identifiers deliberately built from UUIDs with leading zero bytes — the ~1/256 case that used to corrupt sync histories before the canonical Base58 fix.
|
Command soak stress-tests the write path against a REAL Things Cloud account by driving the things-cli binary through many create/edit/move/ complete/trash cycles, including identifiers deliberately built from UUIDs with leading zero bytes — the ~1/256 case that used to corrupt sync histories before the canonical Base58 fix. |
|
statedebug
command
|
|
|
synctest
command
|
|
|
things-cli
command
|
|
|
thingsync
command
|
|
|
trace
command
|
|
|
state
|
|
|
Package sync provides a persistent sync engine for Things Cloud.
|
Package sync provides a persistent sync engine for Things Cloud. |
|
Package syncutil provides shared utilities for sync-based CLI tools.
|
Package syncutil provides shared utilities for sync-based CLI tools. |