Documentation
¶
Index ¶
- Constants
- type APIImplementor
- func (APIImplementor) CreatePartition(diskID string) error
- func (APIImplementor) DiskHasPage83ID(disk syscall.Handle, matchID string) (bool, error)
- func (imp APIImplementor) DiskStats(diskID string) (int64, error)
- func (imp APIImplementor) GetAttachState(diskID string) (bool, error)
- func (APIImplementor) GetDiskNumber(disk syscall.Handle) (uint32, error)
- func (imp APIImplementor) GetDiskNumberByName(diskName string) (string, error)
- func (imp APIImplementor) GetDiskNumberWithID(page83ID string) (uint32, error)
- func (APIImplementor) GetDiskPage83ID(disk syscall.Handle) (string, error)
- func (APIImplementor) InitializeDisk(diskID string) error
- func (APIImplementor) IsDiskInitialized(diskID string) (bool, error)
- func (imp APIImplementor) ListDiskIDs() (map[string]shared.DiskIDs, error)
- func (APIImplementor) ListDiskLocations() (map[string]shared.DiskLocation, error)
- func (APIImplementor) PartitionsExist(diskID string) (bool, error)
- func (APIImplementor) Rescan() error
- func (imp APIImplementor) SetAttachState(diskID string, isOnline bool) error
- type AdditionalParameters
- type DeviceType
- type DiskPath
- type StorageAssociationType
- type StorageDeviceIDDescriptor
- type StorageDeviceNumber
- type StorageIdentifier
- type StorageIdentifierCodeSet
- type StorageIdentifierType
- type StoragePropertyID
- type StoragePropertyQuery
- type StorageQueryType
Constants ¶
const ( IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x2D1080 IOCTL_STORAGE_QUERY_PROPERTY = 0x002d1400 )
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 )
const ( StorageIDCodeSetReserved StorageIdentifierCodeSet = 0 StorageIDCodeSetBinary = 1 StorageIDCodeSetASCII = 2 StorageIDCodeSetUtf8 = 3 )
const ( StorageIdTypeVendorSpecific StorageIdentifierType = 0 StorageIDTypeVendorID = 1 StorageIDTypeEUI64 = 2 StorageIDTypeFCPHName = 3 StorageIDTypePortRelative = 4 StorageIDTypeTargetPortGroup = 5 StorageIDTypeLogicalUnitGroup = 6 StorageIDTypeMD5LogicalUnitIdentifier = 7 StorageIDTypeScsiNameString = 8 )
const ( StorageIDAssocDevice StorageAssociationType = 0 StorageIDAssocPort = 1 StorageIDAssocTarget = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIImplementor ¶
type APIImplementor struct{}
Implements the OS API calls related to Disk Devices. All code here should be very simple pass-through to the OS APIs or cmdlets. Any logic around the APIs/cmdlet invocation should go in internal/server/filesystem/disk.go so that logic can be easily unit-tested without requiring specific OS environments.
func New ¶
func New() APIImplementor
func (APIImplementor) CreatePartition ¶
func (APIImplementor) CreatePartition(diskID string) error
func (APIImplementor) DiskHasPage83ID ¶ added in v0.2.0
func (APIImplementor) DiskStats ¶ added in v0.2.0
func (imp APIImplementor) DiskStats(diskID string) (int64, error)
func (APIImplementor) GetAttachState ¶ added in v0.2.2
func (imp APIImplementor) GetAttachState(diskID string) (bool, error)
func (APIImplementor) GetDiskNumber ¶ added in v0.2.0
func (APIImplementor) GetDiskNumber(disk syscall.Handle) (uint32, error)
func (APIImplementor) GetDiskNumberByName ¶
func (imp APIImplementor) GetDiskNumberByName(diskName string) (string, error)
func (APIImplementor) GetDiskNumberWithID ¶ added in v0.2.0
func (imp APIImplementor) GetDiskNumberWithID(page83ID string) (uint32, error)
func (APIImplementor) GetDiskPage83ID ¶ added in v0.2.0
func (APIImplementor) GetDiskPage83ID(disk syscall.Handle) (string, error)
func (APIImplementor) InitializeDisk ¶
func (APIImplementor) InitializeDisk(diskID string) error
func (APIImplementor) IsDiskInitialized ¶
func (APIImplementor) IsDiskInitialized(diskID string) (bool, error)
func (APIImplementor) ListDiskIDs ¶ added in v0.2.0
func (imp APIImplementor) ListDiskIDs() (map[string]shared.DiskIDs, error)
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 (APIImplementor) ListDiskLocations ¶
func (APIImplementor) ListDiskLocations() (map[string]shared.DiskLocation, error)
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 (APIImplementor) PartitionsExist ¶
func (APIImplementor) PartitionsExist(diskID string) (bool, error)
func (APIImplementor) Rescan ¶
func (APIImplementor) Rescan() error
func (APIImplementor) SetAttachState ¶ added in v0.2.2
func (imp APIImplementor) SetAttachState(diskID string, isOnline bool) error
type AdditionalParameters ¶ added in v0.2.0
type AdditionalParameters byte
type DeviceType ¶ added in v0.2.0
type DeviceType uint32
type StorageAssociationType ¶ added in v0.2.0
type StorageAssociationType uint32
type StorageDeviceIDDescriptor ¶ added in v0.2.0
type StorageDeviceNumber ¶ added in v0.2.0
type StorageDeviceNumber struct { DeviceType DeviceType DeviceNumber uint32 PartitionNumber uint32 }
type StorageIdentifier ¶ added in v0.2.0
type StorageIdentifier struct { CodeSet StorageIdentifierCodeSet Type StorageIdentifierType IdentifierSize uint16 NextOffset uint16 Association StorageAssociationType Identifier [1]byte }
type StorageIdentifierCodeSet ¶ added in v0.2.0
type StorageIdentifierCodeSet uint32
type StorageIdentifierType ¶ added in v0.2.0
type StorageIdentifierType uint32
type StoragePropertyID ¶ added in v0.2.0
type StoragePropertyID uint32
type StoragePropertyQuery ¶ added in v0.2.0
type StoragePropertyQuery struct { PropertyID StoragePropertyID QueryType StorageQueryType Byte []AdditionalParameters }
type StorageQueryType ¶ added in v0.2.0
type StorageQueryType uint32
const ( PropertyStandardQuery StorageQueryType = iota PropertyExistsQuery PropertyMaskQuery PropertyQueryMaxDefined )