aboutsummaryrefslogtreecommitdiff
path: root/refstore/files/transaction_queue_ops.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-07 18:09:20 +0800
committerGravatar Runxi Yu2026-03-07 18:17:54 +0800
commite667c3c52a535ee67fe895bb0240fbad6e920087 (patch)
tree0815f7cc9b2c4a06d00722bce4c3ac57c515288b /refstore/files/transaction_queue_ops.go
parentreceivepack: Connect protocol with service (diff)
signatureNo signature
refstore/files: Accept timeout instead of reading from config
And split things up again.
Diffstat (limited to 'refstore/files/transaction_queue_ops.go')
-rw-r--r--refstore/files/transaction_queue_ops.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/refstore/files/transaction_queue_ops.go b/refstore/files/transaction_queue_ops.go
new file mode 100644
index 00000000..ff966559
--- /dev/null
+++ b/refstore/files/transaction_queue_ops.go
@@ -0,0 +1,35 @@
+package files
+
+import "codeberg.org/lindenii/furgit/objectid"
+
+func (tx *Transaction) Create(name string, newID objectid.ObjectID) error {
+ return tx.queue(txOp{name: name, kind: txCreate, newID: newID})
+}
+
+func (tx *Transaction) Update(name string, newID, oldID objectid.ObjectID) error {
+ return tx.queue(txOp{name: name, kind: txUpdate, newID: newID, oldID: oldID})
+}
+
+func (tx *Transaction) Delete(name string, oldID objectid.ObjectID) error {
+ return tx.queue(txOp{name: name, kind: txDelete, oldID: oldID})
+}
+
+func (tx *Transaction) Verify(name string, oldID objectid.ObjectID) error {
+ return tx.queue(txOp{name: name, kind: txVerify, oldID: oldID})
+}
+
+func (tx *Transaction) CreateSymbolic(name, newTarget string) error {
+ return tx.queue(txOp{name: name, kind: txCreateSymbolic, newTarget: newTarget})
+}
+
+func (tx *Transaction) UpdateSymbolic(name, newTarget, oldTarget string) error {
+ return tx.queue(txOp{name: name, kind: txUpdateSymbolic, newTarget: newTarget, oldTarget: oldTarget})
+}
+
+func (tx *Transaction) DeleteSymbolic(name, oldTarget string) error {
+ return tx.queue(txOp{name: name, kind: txDeleteSymbolic, oldTarget: oldTarget})
+}
+
+func (tx *Transaction) VerifySymbolic(name, oldTarget string) error {
+ return tx.queue(txOp{name: name, kind: txVerifySymbolic, oldTarget: oldTarget})
+}