Documentation ¶
Overview ¶
Package gc implements garbage collection for blob stores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Keep ¶
type Keep interface { Add(context.Context, bs.Ref) error Contains(context.Context, bs.Ref) (bool, error) }
Keep is a set of refs to protect from garbage collection.
type ProtectFunc ¶
ProtectFunc is the type of the callback passed to Protect. It is responsible for traversing a given ref to other refs that must also be protected. It should not do this recursively: that's handled within Protect itself. (However, it safely may, as long as it does its own loop detection. [Assuming loops are even a thing in content-addressable storage systems, which they probably aren't.]) It produces the refs it finds, along with their own ProtectFuncs.
type ProtectPair ¶
type ProtectPair struct { Ref bs.Ref F ProtectFunc }
ProtectPair is the type of an item returned by a ProtectFunc. It is a ref to add to a Keep, plus an optional ProtectFunc for traversing the ref and finding additional refs to protect.
type Store ¶
type Store struct { S bs.DeleterStore Refs, Deletions int }
Store is a DeleterStore that delegates calls to a nested DeleterStore and can count refs and deletions during a call to Run.