gitlab.com/SiaPrime/SiaPrime@v1.4.1/modules/renter/siadir/consts.go (about)

     1  package siadir
     2  
     3  import (
     4  	"gitlab.com/SiaPrime/writeaheadlog"
     5  )
     6  
     7  const (
     8  	// updateDeleteName is the name of a siaDir update that deletes the
     9  	// specified metadata file.
    10  	updateDeleteName = "SiaDirDelete"
    11  
    12  	// updateMetadataName is the name of a siaDir update that inserts new
    13  	// information into the metadata file
    14  	updateMetadataName = "SiaDirMetadata"
    15  
    16  	// threadDepth is how deep the ThreadType will track calling files and
    17  	// calling lines
    18  	threadDepth = 3
    19  
    20  	// dirListRoutines is the number of goroutines used in DirList to load siadir
    21  	// metadata from disk
    22  	dirListRoutines = 20
    23  )
    24  
    25  // IsSiaDirUpdate is a helper method that makes sure that a wal update belongs
    26  // to the SiaDir package.
    27  func IsSiaDirUpdate(update writeaheadlog.Update) bool {
    28  	switch update.Name {
    29  	case updateMetadataName, updateDeleteName:
    30  		return true
    31  	default:
    32  		return false
    33  	}
    34  }