diff options
| author | 2026-03-25 14:31:16 +0000 | |
|---|---|---|
| committer | 2026-03-25 14:31:16 +0000 | |
| commit | 48ff647cf4a8bb8f23fcd6b8616f56a8ef72b980 (patch) | |
| tree | ae199c38042adaa544d5f7d31351661d5831381e /refstore/transaction.go | |
| parent | *: objectstore -> object/store (diff) | |
| signature | No signature | |
*: refstore -> ref/store
Diffstat (limited to 'refstore/transaction.go')
| -rw-r--r-- | refstore/transaction.go | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/refstore/transaction.go b/refstore/transaction.go deleted file mode 100644 index a70cd3d4..00000000 --- a/refstore/transaction.go +++ /dev/null @@ -1,50 +0,0 @@ -package refstore - -import objectid "codeberg.org/lindenii/furgit/object/id" - -// Transaction stages reference updates for one atomic commit. -// -// A transaction borrows its underlying store and is invalid after that store -// is closed. -// -// Ordinary methods operate in dereference mode if name resolves to -// a symbolic ref, the operation applies to the final referent rather -// than to the symbolic ref itself. -// -// Symbolic methods operate on the named reference directly, without -// dereferencing symbolic refs. -type Transaction interface { - // Create creates one detached reference, requiring that the logical - // reference does not already exist. - Create(name string, newID objectid.ObjectID) error - // Update updates one detached reference, requiring that the current logical - // reference value matches oldID. - Update(name string, newID, oldID objectid.ObjectID) error - // Delete deletes one detached reference, requiring that the current logical - // reference value matches oldID. - Delete(name string, oldID objectid.ObjectID) error - // Verify verifies that the current logical reference value matches oldID. - Verify(name string, oldID objectid.ObjectID) error - - // CreateSymbolic creates one symbolic reference, requiring that the named - // reference does not already exist. - CreateSymbolic(name, newTarget string) error - // UpdateSymbolic updates one symbolic reference directly, requiring that its - // current target matches oldTarget. - UpdateSymbolic(name, newTarget, oldTarget string) error - // DeleteSymbolic deletes one symbolic reference directly, requiring that its - // current target matches oldTarget. - DeleteSymbolic(name, oldTarget string) error - // VerifySymbolic verifies that the named symbolic reference currently points - // at oldTarget. - VerifySymbolic(name, oldTarget string) error - - // Commit validates and applies all queued operations atomically. - // - // Commit is terminal. Further use of the transaction is undefined behavior. - Commit() error - // Abort abandons the transaction and releases any resources it holds. - // - // Abort is terminal. Further use of the transaction is undefined behavior. - Abort() error -} |
