patchmodels

package
v0.1.0-rc.8 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: AGPL-3.0 Imports: 1 Imported by: 0

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

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

type PatchError struct {
	PatchID   string `json:"patchId"`
	ErrorCode string `json:"errorCode"`
}

PatchError represents an error that occurred during a patch operation.

Jump to

Keyboard shortcuts

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