Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ItemTypeTask is the type for tasks ItemTypeTask = "task" // ItemTypeNote is the type for notes ItemTypeNote = "note" )
View Source
const ( // PatchActionCreate represents a create action in patch operations PatchActionCreate = "create" // PatchActionUpdate represents an update action in patch operations PatchActionUpdate = "update" // PatchActionDelete represents a delete action in patch operations PatchActionDelete = "delete" )
Variables ¶
View Source
var ValidItemTypes = []string{ItemTypeTask, ItemTypeNote}
ValidItemTypes contains the valid item types for patch operations
View Source
var ValidPatchActions = []string{PatchActionCreate, PatchActionUpdate, PatchActionDelete}
ValidPatchActions contains the valid actions for patch operations
Functions ¶
This section is empty.
Types ¶
type ConflictedItem ¶
type ConflictedItem struct {
Type string `json:"type"`
PatchID string `json:"patchId"`
RemoteObject interface{} `json:"remoteObject"`
}
ConflictedItem represents a conflicted item during bulk operations
type Patch ¶
type Patch struct {
ID primitive.ObjectID `json:"id" bson:"_id" binding:"required"`
Action string `json:"action" bson:"action" binding:"required"`
ItemType string `json:"itemType" bson:"item_type" binding:"required"`
ItemID *primitive.ObjectID `json:"itemId" bson:"item_id"`
Changes []PatchChange `json:"changes" bson:"changes" binding:"required"`
PatchDate *primitive.DateTime `json:"patchDate" bson:"patch_date" binding:"required"`
Force *bool `json:"force,omitempty" bson:"force,omitempty"`
CreatedAt *primitive.DateTime `json:"createdAt" bson:"created_at"`
UpdatedAt *primitive.DateTime `json:"updatedAt" bson:"updated_at"`
}
Patch represents a patch operation on an item in the system.
type PatchChange ¶
type PatchChange struct {
Key string `json:"key" bson:"key" binding:"required"`
Value interface{} `json:"value" bson:"value" binding:"required"`
}
PatchChange represents a change in a patch operation.
type PatchError ¶
PatchError represents an error that occurred during a patch operation.
Click to show internal directories.
Click to hide internal directories.