Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

object/store: Hybrid quarantine interface

Runxi Yu 33a57ddd c3fe7af6

+24 -1
+3 -1
object/store/doc.go
··· 9 9 // very different write models: writing one loose object is natural, while 10 10 // writing one object into a packfile backend is wasteful. Instead, we define 11 11 // distinct optional capabilities for object-wise writes, pack-wise writes, 12 - // and compose them against quarantined writes. 12 + // and compose them against quarantined writes. Where one logical quarantine 13 + // supports multiple write shapes together, this package also defines a 14 + // coordinated writer quarantine capability. 13 15 // 14 16 // Concrete implementations generally inherit the contract documented by the 15 17 // interfaces they satisfy. Implementation docs focus on additional guarantees
+21
object/store/quarantine_writer.go
··· 1 + package objectstore 2 + 3 + // WriterQuarantine represents one quarantined write that accepts both object- 4 + // wise and pack-wise writes. 5 + type WriterQuarantine interface { 6 + Quarantine 7 + ObjectWriter 8 + PackWriter 9 + } 10 + 11 + // QuarantineOptions controls the options for one coordinated quarantine creation. 12 + type QuarantineOptions struct { 13 + Object ObjectQuarantineOptions 14 + Pack PackQuarantineOptions 15 + } 16 + 17 + // WriterQuarantiner creates coordinated quarantines that support both object- 18 + // wise and pack-wise writes. 19 + type WriterQuarantiner interface { 20 + BeginQuarantine(opts QuarantineOptions) (WriterQuarantine, error) 21 + }