Versions in this module Expand all Collapse all v4 v4.6.0 Dec 12, 2024 Changes in this version + const DoradoV6Prefix + const OceanStorV5Prefix + var ExecShellCmd = func(ctx context.Context, format string, args ...interface{}) (string, error) + var PathExist = func(path string) (bool, error) + func AtoiWithDefault(s string, defaultResult int) int + func CheckExistCode(err error, checkExitCode []string) error + func ChmodFsPermission(ctx context.Context, targetPath, fsPermission string) + func Contains[T comparable](sources []T, target T) bool + func ConvertMapToStruct[T any](params map[string]any) (*T, error) + func CopyMap(srcMap interface{}) map[string]interface + func CreateSymlink(ctx context.Context, source string, target string) error + func Errorf(ctx context.Context, format string, a ...interface{}) error + func Errorln(ctx context.Context, msg string) error + func ExecShellCmdFilterLog(ctx context.Context, format string, args ...interface{}) (string, error) + func GetAccessModeType(accessMode csi.VolumeCapability_AccessMode_Mode) string + func GetAlua(ctx context.Context, alua map[string]interface{}, host string) map[string]interface + func GetCertFromSecret(ctx context.Context, SecretName, SecretNamespace string) ([]byte, error) + func GetDtreeSharePath(name string) string + func GetFSSharePath(name string) string + func GetFSSnapshotName(name string) string + func GetFileSystemName(name string) string + func GetForbiddenMultipath(ctx context.Context, multipathConfig map[string]interface{}, ...) []string + func GetFusionStorageLunName(name string) string + func GetFusionStorageSnapshotName(name string) string + func GetHostName(ctx context.Context) (string, error) + func GetLunUniqueId(ctx context.Context, protocol string, lun map[string]interface{}) (string, error) + func GetOriginSharePath(name string) string + func GetPasswordFromSecret(ctx context.Context, SecretName, SecretNamespace string) (string, error) + func GetProductVersion(systemInfo map[string]interface{}) (string, error) + func GetRequiredMultipath(ctx context.Context, multipathConfig map[string]interface{}, ...) ([]string, error) + func GetSharePath(name string) string + func GetSnapshotName(name string) string + func GetValueByRegexp(sourceString string, patternString string, valueIndex int) string + func IgnoreExistCode(err error, checkExitCode []string) error + func IsCapacityAvailable(volumeSizeBytes int64, allocationUnitBytes int64) bool + func IsContain[T constants.FileType | string](target T, list []T) bool + func IsDebugLog(method, url string, debugLogMap map[string]map[string]bool, ...) bool + func IsPathSymlink(targetPath string) (symlink bool, err error) + func IsPathSymlinkWithTimeout(targetPath string, duration time.Duration) (bool, error) + func IsSupportFeature(features map[string]int, feature string) bool + func MaskConnSensitiveInfo(info interface{}) string + func MaskSensitiveInfo(info interface{}) string + func MergeMap(args ...map[string]interface{}) map[string]interface + func NewContextWithRequestID() context.Context + func ParseIntWithDefault(s string, base int, bitSize int, defaultResult int64) int64 + func RandomInt(n int) int + func ReadWwnFile(ctx context.Context, volumeId string) (string, error) + func RecoverPanic(ctx context.Context) + func ReflectCall(obj interface{}, method string, args ...interface{}) []reflect.Value + func RemoveDir(filePath, dir string) + func RemoveString(slice []string, s string) []string + func RemoveSymlink(ctx context.Context, target string) error + func RemoveWwnFile(ctx context.Context, volumeId string) error + func ResCodeExist(code interface{}) bool + func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64 + func SplitSnapshotId(snapshotId string) (string, string, string) + func SplitVolumeId(volumeId string) (string, string) + func StrToBool(ctx context.Context, str string) bool + func StringContain(strPrefix string, stringList []string) bool + func ToStringSafe(i interface{}) string + func ToStringWithFlag(i interface{}) (string, bool) + func TransK8SCapacity(volumeSizeSectors, allocationUnitBytes int64) int64 + func TransToInt(v interface{}) (int, error) + func TransToIntStrict(ctx context.Context, val interface{}) (int, error) + func TransVolumeCapacity(size int64, unit int64) int64 + func WaitUntil(f func() (bool, error), timeout time.Duration, interval time.Duration) error + func WriteWWNFile(ctx context.Context, wwn, volumeId string) error + func WriteWWNFileIfNotExist(ctx context.Context, wwn, volumeId string) error + type Semaphore struct + func NewSemaphore(permits int) *Semaphore + func (s *Semaphore) Acquire() + func (s *Semaphore) AvailablePermits() int + func (s *Semaphore) GetChannel() chan int + func (s *Semaphore) Release() + type Volume interface + GetDTreeParentName func() string + GetFilesystemMode func() string + GetID func() string + GetLunWWN func() (string, error) + GetSize func() (int64, error) + GetVolumeName func() string + SetDTreeParentName func(string) + SetFilesystemMode func(string) + SetID func(string) + SetLunWWN func(string) + SetSize func(int64) + func NewVolume(name string) Volume + type VolumeMetrics struct + Available *resource.Quantity + Capacity *resource.Quantity + Inodes *resource.Quantity + InodesFree *resource.Quantity + InodesUsed *resource.Quantity + Used *resource.Quantity + func GetVolumeMetrics(path string) (*VolumeMetrics, error)