spc

package
v0.0.0-...-20aa718 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	CurTemp             int16
	MinTemp             int16
	MaxTemp             int16
	SpareSpace          byte
	LifeLeft            byte
	Used                byte
	FormFactor          string
	Rotation            uint16
	ModelNumber         string
	SerialNumber        string
	FirmwareRevision    string
	Transport           string
	LogSectorSize       uint32
	PowerCycleCount     uint64
	PowerOnHours        uint64
	UnsafeShutdownCount uint64
	TotalLBAWritten     uint64
	TotalLBARead        uint64
	SigSpeed            string
	NegSpeed            string
	ErrorRecords        []*SmartRecord
	SelfTestSupport     bool
	ErrorLoggingSupport bool
	// contains filtered or unexported fields
}

Device represents a SCSI/ATA device

func NewDevice

func NewDevice(post PostFunc, ioctlDeviceFilePath string, diskType DiskType) *Device

NewDevice make new SCSI/ATA device

func (*Device) Decode

func (d *Device) Decode() error

Decode shapes SCSI/ATA device via mox.Decoder interface

type DiskType

type DiskType string

DiskType represents Divice Protocol (SATA/SAS)

const (
	// SATADisk represents SATA protocol
	SATADisk DiskType = "SATA"
	// SASDisk represents SAS protocol
	SASDisk DiskType = "SAS"
	// UnknownTypeDisk represents unknown protocol
	UnknownTypeDisk DiskType = "Unknown"
)

func CastDiskType

func CastDiskType(s string) DiskType

CastDiskType cast from strint to DiskType

type PostFunc

type PostFunc func(*os.File, []byte) ([]byte, error)

PostFunc represents type of post function

type SmartRecord

type SmartRecord struct {
	ID        byte
	Current   byte
	Worst     byte
	Raw       int64
	Threshold byte
	Name      string
}

SmartRecord represents a s.m.a.r.t record

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL