Documentation
¶
Overview ¶
Package backup contains OpenCloud backup functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckProviderConsistency ¶
func CheckProviderConsistency(storagepath string, lbs ListBlobstore, fail bool) error
CheckProviderConsistency checks the consistency of a space
Types ¶
type Consistency ¶
type Consistency struct {
// Storing the data like this might take a lot of memory
// we might need to optimize this if we run into memory issues
Nodes map[string][]Inconsistency
LinkedNodes map[string][]Inconsistency
BlobReferences map[string][]Inconsistency
Blobs map[string][]Inconsistency
// contains filtered or unexported fields
}
Consistency holds the node and blob data of a storage provider
func NewConsistency ¶
func NewConsistency() *Consistency
NewConsistency creates a new Consistency object
func (*Consistency) GatherData ¶
func (c *Consistency) GatherData(events <-chan interface{})
GatherData gathers and evaluates data produced by the DataProvider
func (*Consistency) PrintResults ¶
func (c *Consistency) PrintResults(discpath string, fail bool) error
PrintResults prints the results of the evaluation
type DataProvider ¶
type DataProvider struct {
Events chan interface{}
// contains filtered or unexported fields
}
DataProvider provides data for the consistency check
func NewProvider ¶
func NewProvider(fsys fs.FS, discpath string, lbs ListBlobstore) *DataProvider
NewProvider creates a new DataProvider object
func (*DataProvider) ProduceData ¶
func (dp *DataProvider) ProduceData() error
ProduceData produces data for the consistency check Spawns 4 go-routines at the moment. If needed, this can be optimized.
type Inconsistency ¶
type Inconsistency string
Inconsistency describes the type of inconsistency
var ( // InconsistencyBlobMissing is an inconsistency where a blob is missing in the blobstore InconsistencyBlobMissing Inconsistency = "blob missing" // InconsistencyBlobOrphaned is an inconsistency where a blob in the blobstore has no reference InconsistencyBlobOrphaned Inconsistency = "blob orphaned" // InconsistencyNodeMissing is an inconsistency where a symlink points to a non-existing node InconsistencyNodeMissing Inconsistency = "node missing" // InconsistencyMetadataMissing is an inconsistency where a node is missing metadata InconsistencyMetadataMissing Inconsistency = "metadata missing" // InconsistencySymlinkMissing is an inconsistency where a node is missing a symlink InconsistencySymlinkMissing Inconsistency = "symlink missing" // InconsistencyFilesMissing is an inconsistency where a node is missing metadata files like .mpk or .mlock InconsistencyFilesMissing Inconsistency = "files missing" // InconsistencyMalformedFile is an inconsistency where a node has a malformed metadata file InconsistencyMalformedFile Inconsistency = "malformed file" )
type ListBlobstore ¶
ListBlobstore required to check blob consistency