utils

package
v0.0.0-...-36737da Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DoradoV6Version = "V600R003C00"
)

Variables

This section is empty.

Functions

func CopyMap

func CopyMap(srcMap interface{}) map[string]interface{}

func ExecShellCmd

func ExecShellCmd(format string, args ...interface{}) (string, error)

func GetAccessModeType

func GetAccessModeType(accessMode csi.VolumeCapability_AccessMode_Mode) string

func GetAlua

func GetAlua(alua map[string]interface{}, host string) map[string]interface{}

func GetBackendAndVolume

func GetBackendAndVolume(volumeId string) (string, string)

func GetFSSharePath

func GetFSSharePath(name string) string

func GetFSSnapshotName

func GetFSSnapshotName(name string) string

func GetFileSystemName

func GetFileSystemName(name string) string

func GetFusionStorageLunName

func GetFusionStorageLunName(name string) string

func GetFusionStorageSnapshotName

func GetFusionStorageSnapshotName(name string) string

func GetHostName

func GetHostName() (string, error)

func GetLunName

func GetLunName(name string) string

func GetLunUniqueId

func GetLunUniqueId(protocol string, lun map[string]interface{}) (string, error)

func GetPathTail

func GetPathTail(device string) string

func GetSharePath

func GetSharePath(name string) string

func GetSnapshotName

func GetSnapshotName(name string) string

func IsDoradoV6

func IsDoradoV6(SystemInfo map[string]interface{}) bool

func IsSupportFeature

func IsSupportFeature(features map[string]int, feature string) bool

func MergeMap

func MergeMap(args ...map[string]interface{}) map[string]interface{}

func PathExist

func PathExist(path string) (bool, error)

func RandomInt

func RandomInt(n int) int

func ReflectCall

func ReflectCall(obj interface{}, method string, args ...interface{}) []reflect.Value

func RoundUpSize

func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64

func SplitSnapshotId

func SplitSnapshotId(snapshotId string) (string, string, string)

func SplitVolumeId

func SplitVolumeId(volumeId string) (string, string)

func StrToBool

func StrToBool(str string) bool

func TransVolumeCapacity

func TransVolumeCapacity(size int64, unit int64) int64

func WaitUntil

func WaitUntil(f func() (bool, error), timeout time.Duration, interval time.Duration) error

Types

type Flock

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

func NewFlock

func NewFlock(file string) *Flock

func (*Flock) Lock

func (p *Flock) Lock() error

func (*Flock) UnLock

func (p *Flock) UnLock()

type Semaphore

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

func NewSemaphore

func NewSemaphore(permits int) *Semaphore

func (*Semaphore) Acquire

func (s *Semaphore) Acquire()

func (*Semaphore) AvailablePermits

func (s *Semaphore) AvailablePermits() int

func (*Semaphore) Release

func (s *Semaphore) Release()

type VolumeMetrics

type VolumeMetrics struct {
	Available  *resource.Quantity
	Capacity   *resource.Quantity
	InodesUsed *resource.Quantity
	Inodes     *resource.Quantity
	InodesFree *resource.Quantity
	Used       *resource.Quantity
}

func GetVolumeMetrics

func GetVolumeMetrics(path string) (*VolumeMetrics, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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