smartpqi

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SysfsPCIDriversPath = "/sys/bus/pci/drivers/smartpqi"

Variables

View Source
var ErrNoArcconf = errors.New("no 'arcconf' command in PATH")

ErrNoArcconf - Error reported by Query if no arcconf binary in PATH

View Source
var ErrNoController = errors.New("smartpqi Controller not found")

ErrNoController - Error reported by Query if no controller is found.

View Source
var ErrUnsupported = errors.New("smartpqi Controller unsupported")

ErrUnsupported - Error reported by Query if controller is not supported.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	ID             int
	PhysicalDrives DriveSet
	LogicalDrives  LogicalDriveSet
}

type DriveSet

type DriveSet map[int]*PhysicalDevice

type LogicalDevice

type LogicalDevice struct {
	ArrayID       int    `json:"ArrayID"`
	BlockSize     int    `json:"BlockSize"`
	Caching       string `json:"Caching"`
	Devices       []*PhysicalDevice
	DiskName      string `json:"DiskName"`
	ID            int    `json:"ID"`
	InterfaceType string `json:"InterfaceType"`
	Name          string `json:"Name"`
	RAIDLevel     string `json:"RAIDLevel"`
	SizeMB        int    `json:"SizeMB"`
}

func (*LogicalDevice) IsSSD

func (ld *LogicalDevice) IsSSD() bool

IsSSD - is this logical device composed of all SSD

type LogicalDriveSet

type LogicalDriveSet map[int]*LogicalDevice

type MediaType

type MediaType int

MediaType

const (
	// UnknownMedia - indicates an unknown media
	UnknownMedia MediaType = iota

	// HDD - Spinning hard disk.
	HDD

	// SSD - Solid State Disk
	SSD

	// NVME - Non Volatile Memory Express
	NVME
)

func GetMediaType

func GetMediaType(mediaType string) MediaType

func (MediaType) MarshalJSON

func (t MediaType) MarshalJSON() ([]byte, error)

MarshalJSON for string output rather than int

func (MediaType) String

func (t MediaType) String() string

func (*MediaType) UnmarshalJSON

func (t *MediaType) UnmarshalJSON(data []byte) error

type PhysicalDevice

type PhysicalDevice struct {
	ArrayID           int       `json:"ArrayID"`
	Availability      string    `json:"Availability"`
	BlockSize         int       `json:"BlockSize"`
	Channel           int       `json:"Channel"`
	ID                int       `json:"ID"`
	Firmware          string    `json:"Firmware"`
	Model             string    `json:"Model"`
	PhysicalBlockSize int       `json:"PhysicalBlockSize"`
	Protocol          string    `json:"Protocol"`
	SerialNumber      string    `json:"SerialNumber"`
	SizeMB            int       `json:"SizeMB"`
	Type              MediaType `json:"Type"`
	Vendor            string    `json:"Vendor"`
	WriteCache        string    `json:"WriteCache"`
}

type SmartPqi

type SmartPqi interface {
	// List  - Return list of Controller IDs
	List() ([]int, error)

	// Query - Query the controller provided
	Query(int) (Controller, error)

	// GetDiskType - Determine the disk type if controller owns disk
	GetDiskType(string) (disko.DiskType, error)

	// DriverSysfsPath - Return the sysfs path to the linux driver for this controller
	DriverSysfsPath() string

	// IsSysPathRAID - Check if sysfs path is a device on the controller
	IsSysPathRAID(string) bool
}

SmartPqi - basic interface

func ArcConf

func ArcConf() SmartPqi

arcConf returns a arcconf specific implementation of SmartPqi interface

Jump to

Keyboard shortcuts

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