Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Verify ¶
func Verify( ctx context.Context, readFiles bool, rootScores []blob.Score, allScores []blob.Score, knownStructure map[Node][]Node, records chan<- Record, blobStore blob.Store) (err error)
Read all blobs necessary for verifying the directory structure rooted at a set of backup root scores, ensuring that the entire directory structure is intact in GCS.
Optionally, all file content is also read and verified. This is less important than verifying directory connectedness if we trust that GCS does not corrupt object metadata (where we store expected CRC32C and MD5) and does correctly report the object's CRC32C and MD5 sums in listings, verifying them periodically.
If work is to be preserved across runs, knownStructure should be filled in with parenthood information from previously-generated records (for both files and directories). Nodes that exist as keys in this map will not be re-verified, except to confirm that their content still exists in allScores.
It is expected that the blob store's Load method does score verification for us.
Types ¶
type Node ¶
type Node struct { Score blob.Score // If true, this node represents a directory listing that has zero or more // children. Otherwise, this is a file or a symlink. Dir bool }
A node in the DAG of blobs in the supplied bucket.
type Record ¶
type Record struct { Time time.Time // The node that was verified. // // For directory nodes, the record certifies that at Time we verified that a // piece of content with the given score was parseable as a directory listing // that referred to the given scores for its direct children. // // For file nodes, the record certifies that at Time we verified that a piece // of content with the given score was parseable as a piece of a file or // symlink. File nodes never have children. Node Node // Child nodes, present only for directories. See notes on Node above. Children []Node }
A record certifying that a node was verified at a particular time.
func ParseRecord ¶
Parse the output of Record.String.