Documentation ¶
Overview ¶
Definitions of protocol structures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaimRequest ¶
type TaskInfo ¶
type TaskInfo struct { ID int64 `json:"id"` Group string `json:"group"` Data string `json:"data"` // The TimeSpec, when positive, indicates an absolute timestamp in // nanoseconds since the epoch (UTC). When negative, its absolute value // will be added to the current time to create an appropriate timestamp. TimeSpec int64 `json:"duration"` // The owner, though present here, will always be ignored when trying to // perform an update. This is informational when obtaining tasks, not used // for changing them. OwnerID int32 `json:"ownerid"` }
type TaskResponse ¶
type TaskResponse struct { Tasks []TaskInfo `json:'newtasks'` Error *TaskResponseError `json:'error'` }
A TaskResponse is used to return slices of tasks and errors. For example, if an UpdateRequest fails, the response will contain a list of reasons for the failure in the errors slice.
type TaskResponseError ¶
type TaskResponseError struct { // Changes contains the list of tasks that were not present and could thus not be changed. Changes []int64 `json:'changes'` // Deletes contains the list of IDs that could not be deleted. Deletes []int64 `json:'deletes'` // Depends contains the list of IDs that were not present and caused the update to fail. Depends []int64 `json:'depends'` // Owned contains the list of IDs that were owned by another client and could not be changed. Owned []int64 `json:'owned'` // Bugs contains a list of errors representing caller precondition failures (bad inputs). Bugs []error `json:'bugs'` }
A TaskResponseError is a slice of errors, one for each portion of a task request that failed.
func (*TaskResponseError) Error ¶
func (te *TaskResponseError) Error() string
Error returns an error string (and satisfies the Error interface).
func (*TaskResponseError) HasBugs ¶
func (te *TaskResponseError) HasBugs() bool
func (*TaskResponseError) HasDependencyErrors ¶
func (te *TaskResponseError) HasDependencyErrors() bool
func (*TaskResponseError) HasErrors ¶
func (te *TaskResponseError) HasErrors() bool
Click to show internal directories.
Click to hide internal directories.