Documentation ¶
Index ¶
- Constants
- func ContextWithHash(ctx context.Context, hash string) context.Context
- func DefaultRetryErrorFunc(e error) bool
- func ExecCommand(command string, args []string) ([]byte, error)
- func GenerateHashInEightBytes(input string) string
- func GetContextHash(ctx context.Context) string
- func IsValidCapacityBytes(cur int64, capRange *csi.CapacityRange) bool
- func ParseIntToDec(hex string) (dec string)
- type ResourceLocks
Constants ¶
View Source
const ( Hash = "Hash" Gib = 1 << 30 )
View Source
const (
OperationPendingFmt = "already an operation for the specified resource %s"
)
Variables ¶
This section is empty.
Functions ¶
func ContextWithHash ¶
ContextWithHash return context with hash value
func DefaultRetryErrorFunc ¶ added in v1.2.0
func ExecCommand ¶
ExecCommand Return cases: normal output, nil: normal output
error logs, error: command execute error
func GenerateHashInEightBytes ¶
GenerateRandIdSuffix generates a random resource id.
func GetContextHash ¶
GetContextHash return hash of context noinspection GoUnusedExportedFunction
func IsValidCapacityBytes ¶
func IsValidCapacityBytes(cur int64, capRange *csi.CapacityRange) bool
Valid capacity bytes in capacity range
func ParseIntToDec ¶
ParseIntToDec convert number string to decimal number string
Types ¶
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.
Click to show internal directories.
Click to hide internal directories.