Documentation
¶
Index ¶
- Constants
- func ConvertSizeToBytes(s string) (string, error)
- func ConvertSizeToBytes64(s string) (string, error)
- func FormatVolume(device, fsType string) error
- func GetDeviceFileFromIscsiPath(iscsiPath string) (devFile string)
- func GetFSType(device string) string
- func GetInitiatorIqns() ([]string, error)
- func GetV(opts map[string]string, key string, defaultValue string) string
- func IscsiDisableDelete(tgt *IscsiTargetInfo) (err error)
- func IscsiDiscovery(portal string) (targets []string, err error)
- func IscsiRescan() (err error)
- func IscsiSessionExists(portal string) (bool, error)
- func IscsiSupported() bool
- func IscsiadmCmd(args []string) ([]byte, error)
- func LoginWithChap(tiqn, portal, username, password, iface string) error
- func Mount(device, mountpoint string) error
- func MultipathFlush() (err error)
- func Pow(x, y int) int
- func Pow64(x int64, y int) int64
- func Stat(fileName string) (string, error)
- func Umount(mountpoint string) error
- func WaitForPathToExist(fileName string, numTries int) bool
- type DFInfo
- type IscsiSessionInfo
- type IscsiTargetInfo
- type ScsiDeviceInfo
Constants ¶
const Darwin = "darwin"
Darwin is a constant value for the runtime.GOOS that represents Apple OSX
const Linux = "linux"
Linux is a constant value for the runtime.GOOS that represents the Linux OS
const Windows = "windows"
Windows is a constant value for the runtime.GOOS that represents the Windows OS
Variables ¶
This section is empty.
Functions ¶
func ConvertSizeToBytes ¶
ConvertSizeToBytes converts size to bytes; see also https://en.wikipedia.org/wiki/Kilobyte
func ConvertSizeToBytes64 ¶
ConvertSizeToBytes64 converts size to bytes; see also https://en.wikipedia.org/wiki/Kilobyte
func FormatVolume ¶
FormatVolume creates a filesystem for the supplied device of the supplied type
func GetDeviceFileFromIscsiPath ¶
GetDeviceFileFromIscsiPath returns the /dev device for the supplied iscsiPath
func GetInitiatorIqns ¶
GetInitiatorIqns returns parsed contents of /etc/iscsi/initiatorname.iscsi
func GetV ¶
GetV takes a map, key, and a defaultValue; will return the value of the key or defaultValue none set
func IscsiDisableDelete ¶
func IscsiDisableDelete(tgt *IscsiTargetInfo) (err error)
IscsiDisableDelete logout from the supplied target and remove the iscsi device
func IscsiDiscovery ¶
IscsiDiscovery uses the 'iscsiadm' command to perform discovery
func IscsiRescan ¶
func IscsiRescan() (err error)
IscsiRescan uses the 'rescan-scsi-bus' command to perform rescanning of the SCSI bus
func IscsiSessionExists ¶
IscsiSessionExists checks to see if a session exists to the sepecified portal
func IscsiSupported ¶
func IscsiSupported() bool
IscsiSupported returns true if iscsiadm is installed and in the PATH
func IscsiadmCmd ¶
IscsiadmCmd uses the 'iscsiadm' command to perform operations
func LoginWithChap ¶
LoginWithChap will login to the iscsi target with the supplied credentials
func MultipathFlush ¶
func MultipathFlush() (err error)
MultipathFlush uses the 'multipath' commands to flush paths that have been removed
func Pow ¶
Pow is an integer version of exponentation; existing builtin is float, we needed an int version
func Pow64 ¶
Pow is an integer version of exponentation; existing builtin is float, we needed an int version
func WaitForPathToExist ¶
WaitForPathToExist retries every second, up to numTries times, for the specified fileName to show up
Types ¶
type IscsiSessionInfo ¶
IscsiSessionInfo contains information about iSCSI sessions
func GetIscsiSessionInfo ¶
func GetIscsiSessionInfo() ([]IscsiSessionInfo, error)
GetIscsiSessionInfo parses output from 'iscsiadm -m session' and returns the parsed output
type IscsiTargetInfo ¶
type IscsiTargetInfo struct {
IP string
Port string
Portal string
Iqn string
Lun string
Device string
Discovery string
}
IscsiTargetInfo structure for usage with the iscsiadm command
type ScsiDeviceInfo ¶
type ScsiDeviceInfo struct {
Host string
Channel string
Target string
LUN string
Device string
MultipathDevice string
Filesystem string
IQN string
}
ScsiDeviceInfo contains information about SCSI devices
func GetDeviceInfoForLuns ¶
func GetDeviceInfoForLuns() ([]ScsiDeviceInfo, error)
GetDeviceInfoForLuns parses 'lsscsi' to find NetApp LUNs
func LsscsiCmd ¶
func LsscsiCmd(args []string) ([]ScsiDeviceInfo, error)
LsscsiCmd executes and parses the output from the 'lsscsi' command