Documentation
¶
Index ¶
- Variables
- type AtaDriverHandle
- type DparmError
- type DriveFactory
- type DriveHandle
- type DriveHandleImpl
- func (p *DriveHandleImpl) AtaDoTaskFileCmd(rw bool, dma bool, tf *ata.Tf, data []byte, timeoutSecs int) error
- func (p *DriveHandleImpl) Close()
- func (p *DriveHandleImpl) GetDevicePath() string
- func (p *DriveHandleImpl) GetDriveInfo() *DriveInfo
- func (p *DriveHandleImpl) GetDriverHandle() DriverHandle
- func (p *DriveHandleImpl) GetDriverName() string
- func (p *DriveHandleImpl) GetDrivingType() DrivingType
- func (p *DriveHandleImpl) GetTcgLevel0InfoAndSerial() (tcg.TcgLevel0Info, string)
- func (p *DriveHandleImpl) Init() error
- func (p *DriveHandleImpl) NvmeGetLogPage(nsid uint32, logId uint32, rae bool, size int) ([]byte, error)
- func (p *DriveHandleImpl) SecurityCommand(rw bool, dma bool, protocol uint8, comId uint16, buffer []byte, ...) error
- func (p *DriveHandleImpl) TcgDiscovery0() error
- type DriveInfo
- type DriveType
- type DriverHandle
- type DrivingType
- type EnumVolumeContext
- type GptPartitionInfo
- type MbrPartitionInfo
- type NestedError
- type NvmeDriverHandle
- type Partition
- type PartitionStyle
- type VolumeInfo
- type WindowsPhysicalDrive
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotSupportThisDriver = errors.New("not supported in this driver")
)
Functions ¶
This section is empty.
Types ¶
type AtaDriverHandle ¶
type DparmError ¶
type DparmError struct {
Message string
DriverStatus byte
SenseData *scsi.SENSE_DATA
// contains filtered or unexported fields
}
func (*DparmError) Error ¶
func (e *DparmError) Error() string
type DriveFactory ¶
type DriveFactory interface {
OpenByPath(path string) (DriveHandle, error)
EnumDrives() ([]DriveInfo, error)
EnumVolumes() (EnumVolumeContext, error)
}
type DriveHandle ¶
type DriveHandle interface {
GetDriverHandle() DriverHandle
Close()
GetDevicePath() string
GetDrivingType() DrivingType
GetDriverName() string
GetDriveInfo() *DriveInfo
// ATA
AtaDoTaskFileCmd(rw bool, dma bool, tf *ata.Tf, data []byte, timeoutSecs int) error
// NVME
NvmeGetLogPage(nsid uint32, logId uint32, rae bool, size int) ([]byte, error)
// COMMON
SecurityCommand(rw bool, dma bool, protocol uint8, comId uint16, buffer []byte, timeoutSecs int) error
// TCG
TcgDiscovery0() error
GetTcgLevel0InfoAndSerial() (tcg.TcgLevel0Info, string)
}
type DriveHandleImpl ¶ added in v0.0.2
type DriveHandleImpl struct {
DriveHandle
Dh DriverHandle
Info DriveInfo
}
func (*DriveHandleImpl) AtaDoTaskFileCmd ¶ added in v0.0.2
func (*DriveHandleImpl) Close ¶ added in v0.0.2
func (p *DriveHandleImpl) Close()
func (*DriveHandleImpl) GetDevicePath ¶ added in v0.0.2
func (p *DriveHandleImpl) GetDevicePath() string
func (*DriveHandleImpl) GetDriveInfo ¶ added in v0.0.2
func (p *DriveHandleImpl) GetDriveInfo() *DriveInfo
func (*DriveHandleImpl) GetDriverHandle ¶ added in v0.0.2
func (p *DriveHandleImpl) GetDriverHandle() DriverHandle
func (*DriveHandleImpl) GetDriverName ¶ added in v0.0.2
func (p *DriveHandleImpl) GetDriverName() string
func (*DriveHandleImpl) GetDrivingType ¶ added in v0.0.2
func (p *DriveHandleImpl) GetDrivingType() DrivingType
func (*DriveHandleImpl) GetTcgLevel0InfoAndSerial ¶ added in v0.3.0
func (p *DriveHandleImpl) GetTcgLevel0InfoAndSerial() (tcg.TcgLevel0Info, string)
func (*DriveHandleImpl) Init ¶ added in v0.0.2
func (p *DriveHandleImpl) Init() error
func (*DriveHandleImpl) NvmeGetLogPage ¶ added in v0.0.2
func (*DriveHandleImpl) SecurityCommand ¶ added in v0.0.2
func (*DriveHandleImpl) TcgDiscovery0 ¶ added in v0.0.2
func (p *DriveHandleImpl) TcgDiscovery0() error
type DriveInfo ¶
type DriveInfo struct {
DevicePath string
DrivingType DrivingType
DriverName string
PartitionStyle PartitionStyle
GptDiskId string // uuid format
MbrDiskSignature uint32
Model string
Serial string
FirmwareRevision string
RawSerial [20]byte
VendorId string
ProductRevision string
WindowsDevNum int
SmartEnabled bool
AtaIdentity *ata.IdentityDeviceData
AtaIdentityRaw []byte
NvmeIdentity *nvme.IdentifyController
NvmeIdentityRaw []byte
IsSsd bool
SsdCheckWeight int
TotalCapacity int64
TcgSupport int
tcg.TcgLevel0Info
Removable int
DriveType DriveType
Partitions []Partition
}
type DriverHandle ¶
type DrivingType ¶
type DrivingType int
const ( DrivingUnknown DrivingType = 0 + iota DrivingAtapi DrivingNvme )
type EnumVolumeContext ¶
type EnumVolumeContext interface {
GetList() []VolumeInfo
FindVolumesByDrive(driveInfo *DriveInfo) []VolumeInfo
OpenDriveByVolumePath(volumePath string) (DriveHandle, error)
OpenDriveByPartition(partition Partition) (DriveHandle, error)
}
type GptPartitionInfo ¶ added in v0.0.2
type MbrPartitionInfo ¶ added in v0.0.2
type NestedError ¶ added in v0.0.2
type NestedError struct {
// contains filtered or unexported fields
}
func NewNestedError ¶ added in v0.0.2
func NewNestedError(msg string, cause error) *NestedError
func (*NestedError) Cause ¶ added in v0.0.2
func (e *NestedError) Cause() error
func (*NestedError) Error ¶ added in v0.0.2
func (e *NestedError) Error() string
type NvmeDriverHandle ¶
type Partition ¶ added in v0.0.2
type Partition interface {
// GetStart bytes
GetStart() uint64
// GetEnd bytes
GetSize() uint64
GetPartitionStyle() PartitionStyle
GetMbrInfo() *MbrPartitionInfo
GetGptInfo() *GptPartitionInfo
}
type PartitionStyle ¶
type PartitionStyle int
const ( PartitionStyleRaw PartitionStyle = 0 + iota PartitionStyleMbr PartitionStyleGpt )
type VolumeInfo ¶
type WindowsPhysicalDrive ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.