Documentation ¶
Index ¶
- Constants
- func ByteCeilToGib(nByte int64) int
- func EntryFunction(functionName string) (info string, hash string)
- func ExitFunction(functionName, hash string) (info string)
- func GenerateHashInEightBytes(input string) string
- func GetRequestSizeBytes(capRange *csi.CapacityRange) (int64, error)
- func GibToByte(nGib int) int64
- func IsValidCapacityBytes(cur int64, capRange *csi.CapacityRange) bool
- func NewSafeMounter() *mount.SafeFormatAndMount
- func ParseEndpoint(ep string) (string, string, error)
- func RetryOnError(backoff wait.Backoff, fn func() error) error
- type NonBlockingGRPCServer
- type ResourceLocks
- type RetryLimiter
Constants ¶
View Source
const ( Kib int64 = 1024 Mib int64 = Kib * 1024 Gib int64 = Mib * 1024 Gib100 int64 = Gib * 100 Tib int64 = Gib * 1024 Tib100 int64 = Tib * 100 )
View Source
const ( FileSystemExt3 string = "ext3" FileSystemExt4 string = "ext4" FileSystemXfs string = "xfs" DefaultFileSystem string = FileSystemExt4 )
View Source
const DefaultTimeFormat = "2006-01-02 15:04:05"
View Source
const Int64Max = int64(^uint64(0) >> 1)
View Source
const (
OperationPendingFmt = "already an operation for the specified resource %s"
)
Variables ¶
This section is empty.
Functions ¶
func EntryFunction ¶
EntryFunction print timestamps
func ExitFunction ¶
ExitFunction print timestamps
func GenerateHashInEightBytes ¶
GenerateRandIdSuffix generates a random resource id.
func GetRequestSizeBytes ¶
func GetRequestSizeBytes(capRange *csi.CapacityRange) (int64, error)
GetRequestSizeBytes get minimal required bytes and not exceed limit bytes.
func IsValidCapacityBytes ¶
func IsValidCapacityBytes(cur int64, capRange *csi.CapacityRange) bool
Valid capacity bytes in capacity range
func NewSafeMounter ¶
func NewSafeMounter() *mount.SafeFormatAndMount
Types ¶
type NonBlockingGRPCServer ¶
type NonBlockingGRPCServer interface { // Start services at the endpoint Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) // Waits for the service to stop Wait() // Stops the service gracefully Stop() // Stops the service forcefully ForceStop() }
Defines Non blocking GRPC server interfaces
func NewNonBlockingGRPCServer ¶
func NewNonBlockingGRPCServer() NonBlockingGRPCServer
type ResourceLocks ¶
type ResourceLocks struct {
// contains filtered or unexported fields
}
ResourceLocks implements a map with atomic operations. It stores a set of all resource IDs with an ongoing operation.
func NewResourceLocks ¶
func NewResourceLocks() *ResourceLocks
func (*ResourceLocks) Release ¶
func (lock *ResourceLocks) Release(resourceID string)
func (*ResourceLocks) TryAcquire ¶
func (lock *ResourceLocks) TryAcquire(resourceID string) bool
TryAcquire tries to acquire the lock for operating on resourceID and returns true if successful. If another operation is already using resourceID, returns false.
type RetryLimiter ¶ added in v1.1.1
type RetryLimiter interface { Add(id string) Try(id string) bool GetMaxRetryTimes() int GetCurrentRetryTimes(id string) int }
func NewRetryLimiter ¶ added in v1.1.1
func NewRetryLimiter(maxRetry int) RetryLimiter
Click to show internal directories.
Click to hide internal directories.