util

package
v0.0.0-...-7dfd596 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMounter = NewMounter()

Functions

func CheckDeviceAvailable

func CheckDeviceAvailable(devicePath string) error

func CreateDest

func CreateDest(dest string) error

CreateDest create de destination dir

func FsInfo

func FsInfo(path string) (int64, int64, int64, int64, int64, int64, error)

FsInfo linux returns (available bytes, byte capacity, byte usage, total inodes, inodes free, inode usage, error) for the filesystem that path resides upon.

func GetDeviceByVolumeID

func GetDeviceByVolumeID(volumeID string) (device string, err error)

GetDeviceByVolumeID First try to find the device by serial If cannot find the device using the serial number, get device by volumeID, link file should be like: /dev/disk/by-id/virtio-163696622650261511 -> ../../vdc

func GetMetrics

func GetMetrics(path string) (*csi.NodeGetVolumeStatsResponse, error)

GetMetrics get path metric

func HttpGet

func HttpGet(url string) (result string, err error)

func IsFileExisting

func IsFileExisting(filename string) bool

IsFileExisting check file exist in volume driver or not

Types

type Mounter

type Mounter interface {
	mount.Interface

	// ForceUnmount the given target
	ForceUnmount(target string) error
}

Mounter is responsible for formatting and mounting volumes

func NewMounter

func NewMounter() Mounter

NewMounter returns a new mounter instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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