Documentation
¶
Index ¶
- Constants
- func C1(blockOffset uint64, numSectors, sectorSlot int, replicaID, seed, ticket []byte, ...) int
- func GenerateMultiString(paths []Path) (string, error)
- func GetCCCommD(commD []byte, sectorSize int) bool
- func GetCommC(commC []byte, cachePath string) bool
- func GetCommCFromTree(commC []byte, cachePath string, sectorSize uint64) bool
- func GetCommD(commD []byte, cachePath string) bool
- func GetCommR(commR []byte, cachePath string) bool
- func GetCommRLast(commRLast []byte, cachePath string) bool
- func GetCommRLastFromTree(commRLast []byte, cachePath string, sectorSize uint64) bool
- func GetMaxBlockOffset(sectorSize uint64) uint64
- func GetSlotSize(numSectors int, sectorSize uint64) uint64
- func Pc1(blockOffset uint64, replicaIDs [][32]byte, parentsFilename string, ...) int
- func Pc2(blockOffset uint64, numSectors int, outputDir string, sectorSize uint64) int
- func Pc2Cleanup(numSectors int, outputDir string, sectorSize uint64) int
- func SetCommC(commC []byte, cachePath string) bool
- func SetCommRLast(commRLast []byte, cachePath string) bool
- func SupraSealInit(sectorSize uint64, configFile string)
- type HealthInfo
- type Path
Constants ¶
const ( WarningSpareSpace = 1 << 0 WarningTemperature = 1 << 1 WarningReliability = 1 << 2 WarningReadOnly = 1 << 3 WarningVolatileMemory = 1 << 4 WarningPersistentMemory = 1 << 5 )
Helper methods for interpreting critical warning flags
Variables ¶
This section is empty.
Functions ¶
func C1 ¶
func C1(blockOffset uint64, numSectors, sectorSlot int, replicaID, seed, ticket []byte, cachePath, parentsFilename, replicaPath string, sectorSize uint64) int
C1 performs the c1 operation.
func GenerateMultiString ¶
GenerateMultiString generates a //multi// string from an array of Path structs
func GetCCCommD ¶
GetCCCommD returns comm_d for a cc sector.
func GetCommCFromTree ¶
GetCommCFromTree returns comm_c after calculating from tree file(s).
func GetCommRLast ¶
GetCommRLast returns comm_r_last from p_aux file.
func GetCommRLastFromTree ¶
GetCommRLastFromTree returns comm_r_last after calculating from tree file(s).
func GetMaxBlockOffset ¶
GetMaxBlockOffset returns the highest available block offset.
func GetSlotSize ¶
GetSlotSize returns the size in blocks required for the given number of sectors.
func Pc2Cleanup ¶
Pc2Cleanup deletes files associated with pc2.
func SetCommRLast ¶
SetCommRLast sets comm_r_last in the p_aux file.
func SupraSealInit ¶
SupraSealInit initializes the supra seal with a sector size and optional config file.
Types ¶
type HealthInfo ¶ added in v1.24.3
type HealthInfo struct { // Critical warning flags CriticalWarning byte // Temperature information in Celsius Temperature float64 TemperatureSensors []float64 WarningTempTime time.Duration CriticalTempTime time.Duration // Reliability metrics AvailableSpare uint8 AvailableSpareThreshold uint8 PercentageUsed uint8 // Usage statistics DataUnitsRead uint64 // in 512-byte units DataUnitsWritten uint64 // in 512-byte units HostReadCommands uint64 HostWriteCommands uint64 ControllerBusyTime time.Duration // Power and error statistics PowerCycles uint64 PowerOnHours time.Duration UnsafeShutdowns uint64 MediaErrors uint64 ErrorLogEntries uint64 }
HealthInfo represents NVMe device health information in a more Go-friendly format
func GetHealthInfo ¶ added in v1.24.3
func GetHealthInfo() ([]HealthInfo, error)
func (*HealthInfo) GetWarnings ¶ added in v1.24.3
func (h *HealthInfo) GetWarnings() []string
GetWarnings returns a slice of active warning descriptions
func (*HealthInfo) HasWarning ¶ added in v1.24.3
func (h *HealthInfo) HasWarning(flag byte) bool
HasWarning checks if a specific warning flag is set