Documentation ¶
Index ¶
Constants ¶
const SysfsPCIDriversPath = "/sys/bus/pci/drivers/megaraid_sas"
Variables ¶
var ErrNoController = errors.New("megaraid Controller not found")
ErrNoController - Error reported by Query if no controller is found.
var ErrNoStorcli = errors.New("no 'storcli' command in PATH")
ErrNoStorcli - Error reported by Query if no storcli binary in PATH
var ErrUnsupported = errors.New("megaraid 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 Drives DriveSet DriveGroups DriveGroupSet VirtDrives VirtDriveSet }
Controller - a Megaraid controller
type Drive ¶
type Drive struct { ID int DriveGroup int EID int Slot int State string MediaType MediaType Model string Raw map[string]string }
Drive - a megaraid (physical) Drive.
type DriveGroup ¶
DriveGroup - a megaraid "Drive Group". These really have nothing that is their own other than their ID.
func (*DriveGroup) IsSSD ¶
func (dg *DriveGroup) IsSSD() bool
IsSSD - is this drive group composed of all SSD
type DriveGroupSet ¶
type DriveGroupSet map[int]*DriveGroup
DriveGroupSet - map of DriveGroups by their ID
func (DriveGroupSet) MarshalJSON ¶
func (dgs DriveGroupSet) MarshalJSON() ([]byte, error)
MarshalJSON - serialize to json. Custom Marshal to only reference Disks by ID not by full dump.
type MediaType ¶
type MediaType int
MediaType - a disk "Media"
func (MediaType) MarshalJSON ¶
MarshalJSON for string output rather than int
type MegaRaid ¶
type MegaRaid interface { // 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 }
MegaRaid - basic interface
type VirtDrive ¶
type VirtDrive struct { // the Virtual Drive Number / ID ID int // the Drive Group ID DriveGroup int // Path in linux - may be empty if "Exposed to OS" != "Yes" Path string // "Name" in output - exposed in cimc UI RaidName string // Type RAID type (RAID0, RAID1...) Type string // /c0/v0 data as a string map Raw map[string]string // "VD0 Properties" as a map Properties map[string]string }
VirtDrive - represents a virtual drive.
type VirtDriveSet ¶
VirtDriveSet - a map of VirtDrives by their Number.