lsscsi

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LsscsiCmdImpl is a base CMD for lsscsi
	LsscsiCmdImpl = "lsscsi --no-nvme"
	// SCSIDeviceSizeCmdImpl is a CMD to get devices size by id
	SCSIDeviceSizeCmdImpl = LsscsiCmdImpl + " --brief --size %s"
	// SCSIDeviceCmdImpl is a CMD to get devices information about Vendor, Model and etc
	SCSIDeviceCmdImpl = LsscsiCmdImpl + " --classic %s"
	// SCSIType is a type of devices we search in lsscsi output
	SCSIType = "disk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LSSCSI

type LSSCSI struct {
	// contains filtered or unexported fields
}

LSSCSI is a wrap for system lsscsi util

func NewLSSCSI

func NewLSSCSI(e command.CmdExecutor, logger *logrus.Logger) *LSSCSI

NewLSSCSI is a constructor for LSSCSI

func (*LSSCSI) GetSCSIDevices

func (la *LSSCSI) GetSCSIDevices() ([]*SCSIDevice, error)

GetSCSIDevices gets information about SCSIDevice using lsscsi util

type SCSIDevice

type SCSIDevice struct {
	ID       string
	Path     string
	Size     int64
	Vendor   string
	Model    string
	Firmware string
}

SCSIDevice represents devices in lsscsi output

type WrapLsscsi

type WrapLsscsi interface {
	GetSCSIDevices() ([]*SCSIDevice, error)
}

WrapLsscsi is an interface that encapsulates operation with system lsscsi util

Jump to

Keyboard shortcuts

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