Documentation
¶
Overview ¶
Package clusterutil holds small helpers that the cluster implementation and the service packages share: context-bounded locking, polling, operation errors and keyring parsing. It depends on neither of them.
Index ¶
- Variables
- func KeyringKey(keyring []byte, entity string) string
- func LockMutex(ctx context.Context, mutex *sync.Mutex) error
- func OperationError(ctx context.Context, operation string, native error) error
- func Poll(ctx context.Context, check func() (bool, error)) error
- func RLockMutex(ctx context.Context, mutex *sync.RWMutex) error
- func TextFile(path string, data []byte, mode int64) testcontainers.ContainerFile
Constants ¶
This section is empty.
Variables ¶
var Quiet = func(visible, native error) error { return visible }
Quiet returns visible, keeping the classification of native without its output; package ceph sets it.
Functions ¶
func KeyringKey ¶
KeyringKey returns the key of entity in a Ceph keyring, or "".
func LockMutex ¶
LockMutex acquires mutex unless ctx ends first. The caller owns Unlock after success. No goroutine remains waiting after cancellation.
func OperationError ¶
OperationError names a failed native operation without its output, which can contain secrets. It keeps the caller's context error and a native cancellation or deadline as causes, and the classification of native without its output.
func Poll ¶
Poll calls check every half second until it reports success without an error or ctx ends. The last error joins the context's error.
func RLockMutex ¶
RLockMutex acquires mutex for reading unless ctx ends first. The caller owns RUnlock after success. Writers may hold this gate across cleanup.
func TextFile ¶
func TextFile(path string, data []byte, mode int64) testcontainers.ContainerFile
TextFile returns data as a file to copy into a container.
Types ¶
This section is empty.