clusterutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

func KeyringKey(keyring []byte, entity string) string

KeyringKey returns the key of entity in a Ceph keyring, or "".

func LockMutex

func LockMutex(ctx context.Context, mutex *sync.Mutex) error

LockMutex acquires mutex unless ctx ends first. The caller owns Unlock after success. No goroutine remains waiting after cancellation.

func OperationError

func OperationError(ctx context.Context, operation string, native error) error

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

func Poll(ctx context.Context, check func() (bool, error)) error

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

func RLockMutex(ctx context.Context, mutex *sync.RWMutex) error

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.

Jump to

Keyboard shortcuts

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