Documentation ¶
Index ¶
- Constants
- func BasicPartitionsExist(diskNumber uint32) (bool, error)
- func CreateBasicPartition(diskNumber uint32) error
- func GetDiskNumber(disk syscall.Handle) (uint32, error)
- func GetDiskNumberAndPage83ID(path string) (uint32, string, error)
- func GetDiskNumberByName(page83ID string) (uint32, error)
- func GetDiskNumberWithID(page83ID string) (uint32, error)
- func GetDiskPage83ID(disk syscall.Handle) (string, error)
- func GetDiskState(diskNumber uint32) (bool, error)
- func GetDiskStats(diskNumber uint32) (int64, error)
- func InitializeDisk(diskNumber uint32) error
- func IsDiskInitialized(diskNumber uint32) (bool, error)
- func ListDiskIDs() (map[uint32]IDs, error)
- func ListDiskLocations() (map[uint32]Location, error)
- func ListDisksUsingCIM() (map[uint32]Location, error)
- func PartitionDisk(diskNumber uint32) error
- func Rescan() error
- func SetDiskState(diskNumber uint32, isOnline bool) error
- type AdditionalParameters
- type DeviceType
- type Disk
- type IDs
- type Location
- type StorageAssociationType
- type StorageDeviceIDDescriptor
- type StorageDeviceNumber
- type StorageIdentifier
- type StorageIdentifierCodeSet
- type StorageIdentifierType
- type StoragePropertyID
- type StoragePropertyQuery
- type StorageQueryType
Constants ¶
View Source
const ( IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x2D1080 IOCTL_STORAGE_QUERY_PROPERTY = 0x002d1400 )
View Source
const ( StorageDeviceProperty StoragePropertyID = 0 StorageAdapterProperty = 1 StorageDeviceIDProperty = 2 StorageDeviceUniqueIDProperty = 3 StorageDeviceWriteCacheProperty = 4 StorageMiniportProperty = 5 StorageAccessAlignmentProperty = 6 StorageDeviceSeekPenaltyProperty = 7 StorageDeviceTrimProperty = 8 StorageDeviceWriteAggregationProperty = 9 StorageDeviceDeviceTelemetryProperty = 10 StorageDeviceLBProvisioningProperty = 11 StorageDevicePowerProperty = 12 StorageDeviceCopyOffloadProperty = 13 StorageDeviceResiliencyProperty = 14 StorageDeviceMediumProductType = 15 StorageAdapterRpmbProperty = 16 StorageAdapterCryptoProperty = 17 StorageDeviceIoCapabilityProperty = 18 StorageAdapterProtocolSpecificProperty = 19 StorageDeviceProtocolSpecificProperty = 20 StorageAdapterTemperatureProperty = 21 StorageDeviceTemperatureProperty = 22 StorageAdapterPhysicalTopologyProperty = 23 StorageDevicePhysicalTopologyProperty = 24 StorageDeviceAttributesProperty = 25 StorageDeviceManagementStatus = 26 StorageAdapterSerialNumberProperty = 27 StorageDeviceLocationProperty = 28 StorageDeviceNumaProperty = 29 StorageDeviceZonedDeviceProperty = 30 StorageDeviceUnsafeShutdownCount = 31 StorageDeviceEnduranceProperty = 32 )
View Source
const ( StorageIDCodeSetReserved StorageIdentifierCodeSet = 0 StorageIDCodeSetBinary = 1 StorageIDCodeSetASCII = 2 StorageIDCodeSetUtf8 = 3 )
View Source
const ( StorageIDTypeVendorSpecific StorageIdentifierType = 0 StorageIDTypeVendorID = 1 StorageIDTypeEUI64 = 2 StorageIDTypeFCPHName = 3 StorageIDTypePortRelative = 4 StorageIDTypeTargetPortGroup = 5 StorageIDTypeLogicalUnitGroup = 6 StorageIDTypeMD5LogicalUnitIdentifier = 7 StorageIDTypeScsiNameString = 8 )
View Source
const ( StorageIDAssocDevice StorageAssociationType = 0 StorageIDAssocPort = 1 StorageIDAssocTarget = 2 )
Variables ¶
This section is empty.
Functions ¶
func BasicPartitionsExist ¶
func CreateBasicPartition ¶
func GetDiskNumberByName ¶
func GetDiskNumberWithID ¶
func GetDiskState ¶
func GetDiskStats ¶
func InitializeDisk ¶
func IsDiskInitialized ¶
func ListDiskIDs ¶
ListDiskIDs - constructs a map with the disk number as the key and the DiskID structure as the value. The DiskID struct has a field for the page83 ID.
func ListDiskLocations ¶
ListDiskLocations - constructs a map with the disk number as the key and the DiskLocation structure as the value. The DiskLocation struct has various fields like the Adapter, Bus, Target and LUNID.
func ListDisksUsingCIM ¶ added in v1.31.2
ListDisksUsingCIM - constructs a map with the disk number as the key and the DiskLocation structure as the value. The DiskLocation struct has various fields like the Adapter, Bus, Target and LUNID.
func PartitionDisk ¶
func SetDiskState ¶
Types ¶
type AdditionalParameters ¶
type AdditionalParameters byte
type DeviceType ¶
type DeviceType uint32
type StorageAssociationType ¶
type StorageAssociationType uint32
type StorageDeviceNumber ¶
type StorageDeviceNumber struct { DeviceType DeviceType DeviceNumber uint32 PartitionNumber uint32 }
type StorageIdentifier ¶
type StorageIdentifier struct { CodeSet StorageIdentifierCodeSet Type StorageIdentifierType IdentifierSize uint16 NextOffset uint16 Association StorageAssociationType Identifier [1]byte }
type StorageIdentifierCodeSet ¶
type StorageIdentifierCodeSet uint32
type StorageIdentifierType ¶
type StorageIdentifierType uint32
type StoragePropertyID ¶
type StoragePropertyID uint32
type StoragePropertyQuery ¶
type StoragePropertyQuery struct { PropertyID StoragePropertyID QueryType StorageQueryType Byte []AdditionalParameters }
type StorageQueryType ¶
type StorageQueryType uint32
const ( PropertyStandardQuery StorageQueryType = iota PropertyExistsQuery PropertyMaskQuery PropertyQueryMaxDefined )
Click to show internal directories.
Click to hide internal directories.