blockdevice

package
v0.0.0-...-eec02a6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SG_IO ioctl constants (from scsi/sg.h)
	SG_IO             = 0x2285 // ioctl command for SCSI Generic I/O
	SG_DXFER_FROM_DEV = -3     // Data transfer from device
	SG_DXFER_TO_DEV   = -2     // Data transfer to device
	SG_DXFER_NONE     = -1     // No data transfer

	// SCSI command opcodes
	SCSI_READ_CAPACITY_10 = 0x25 // READ CAPACITY(10)
	SCSI_READ_CAPACITY_16 = 0x9e // SERVICE ACTION IN(16) for READ CAPACITY(16)
	SCSI_INQUIRY          = 0x12 // INQUIRY command
	SCSI_LOG_SENSE        = 0x4d // LOG SENSE command

)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDevice

type BlockDevice interface {
	// GetBlockDeviceStats returns capacity statistics for a block device
	// devicePath: path to block device (e.g., /dev/sda, /dev/mapper/mpatha, /dev/nvme0n1)
	// protocol: storage protocol type ("iscsi", "nvme", "fc", or empty for auto-detection)
	// Returns: (used, available, capacity, error)
	GetBlockDeviceStats(ctx context.Context, devicePath, protocol string) (used, available, capacity int64, err error)
}

BlockDevice defines interface for block device statistics

type Client

type Client struct {
}

Client manages block device operations

func New

func New() *Client

New creates a new BlockDevice client

func (*Client) GetBlockDeviceStats

func (c *Client) GetBlockDeviceStats(ctx context.Context, devicePath, protocol string) (used, available, capacity int64, err error)

GetBlockDeviceStats implements the BlockDevice interface for Linux

Jump to

Keyboard shortcuts

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