Documentation
¶
Overview ¶
Package quarantine is the data no object names that a start-up reclaim moves aside instead of deleting (ADR-0288): an entry per moved object, dated by its move, and the port each store's quarantine implements. Each store keeps its entries beside its data: the KV substrate's keys, the blob store's Buckets, the SQL directories, the Function volumes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
Entry is one object's quarantined data: Since is when its move began, to the ms.
func Pick ¶
Pick is the entry Return takes among ref's entries: the one dated since, else the newest. Returning wins, as a cut return resumes; fault.NotFound when none.
type Ref ¶
type Ref struct {
v1.ObjectRef
Volume v1.ObjectName
}
Ref names the object an entry holds the data of: a volume's Function, with Volume its volume, else "".
type Returner ¶
Returner is a Store whose entries `funcdctl quarantine return` brings back: KVStore, Bucket and Function volume. Return moves ref's Kept entry dated since, the newest when since is zero, back into the data of ref's object: fault.NotFound without such an entry, fault.Conflict when that data is not empty. A Returning entry resumes, its emptiness check skipped. That the object exists is the caller's check (Decision 6).
type State ¶
type State string
State is an entry's state (Decision 2). A copy move writes Moving before its first copy and Kept after it deleted the source; a rename move writes none; a return writes Returning first. A missing state reads Kept.
The states of Decision 2.
func ParseState ¶
ParseState reads a stored state: empty, the missing state, is Kept.
type Store ¶
type Store interface {
// Move moves ref's data into a new entry dated now, or resumes ref's Moving entry.
Move(ctx context.Context, ref Ref, now time.Time) (Entry, error)
// List returns the entries, an entry with neither data nor state skipped.
List(ctx context.Context) ([]Entry, error)
// Expire deletes each entry Expired at cutoff, and each entry with neither data nor state, and returns the first.
Expire(ctx context.Context, cutoff time.Time) ([]Entry, error)
}
Store is one kind's quarantine.