Documentation ¶
Index ¶
- Variables
- func AnalyzeErrors(msg string) error
- func CancelAny(ctxs ...context.Context) context.Context
- func Must(arg interface{}, err error) interface{}
- func NotifyBackground(ctx context.Context, timeout time.Duration, name string) *waitNotifier
- func NotifyBlocking(ctx context.Context, timeout time.Duration, name string, f func())
- func RunOnNotify(ctx context.Context, c <-chan struct{}, funcs ...func())
- func RunPeriodic(ctx context.Context, duration time.Duration, factor float64, now bool, ...)
- func SetNotifyTimeoutHandler(handler func(NotifyTimeoutInfo))
- func TopLevelTempDir() (string, error)
- type HashServer
- type Hashable
- type NotifyTimeoutInfo
- type NullableError
- type PauseController
- type PauseControllerOption
- type PauseControllerOptions
- type ReadDirStatFS
- type ZapfLogShim
- func (lg ZapfLogShim) Enabled(level int) bool
- func (lg ZapfLogShim) Error(err error, msg string, keysAndValues ...interface{})
- func (lg ZapfLogShim) Info(level int, msg string, keysAndValues ...interface{})
- func (lg ZapfLogShim) Init(info logr.RuntimeInfo)
- func (lg ZapfLogShim) V(level int) logr.LogSink
- func (lg ZapfLogShim) WithName(name string) logr.LogSink
- func (lg ZapfLogShim) WithValues(keysAndValues ...interface{}) logr.LogSink
Constants ¶
This section is empty.
Variables ¶
var CalculatePatch = patchMaker.Calculate
var OSFS osfs
OSFS represents the host operating system's FS.
var PreferredTempDirectory string
var SetLastAppliedAnnotation = annotator.SetLastAppliedAnnotation
Functions ¶
func AnalyzeErrors ¶
AnalyzeErrors analyzes error messages to find oddities and potential bugs.
func NotifyBackground ¶
func NotifyBlocking ¶
func RunOnNotify ¶
RunPeriodic runs each function given in funcs (in parallel) every time the channel receives a value. It stops when either the channel is closed or the context is canceled.
func RunPeriodic ¶
func RunPeriodic( ctx context.Context, duration time.Duration, factor float64, now bool, funcs ...func(), )
RunPeriodic runs each function given in funcs (in parallel) every given duration until the context is done. A jitter factor can be provided, or set to a negative number to disable jitter. If now is true, the functions will be run once immediately before starting the timer.
func SetNotifyTimeoutHandler ¶
func SetNotifyTimeoutHandler(handler func(NotifyTimeoutInfo))
func TopLevelTempDir ¶
Types ¶
type HashServer ¶
type HashServer struct {
// contains filtered or unexported fields
}
HashServer uses the md5-simd library to allow highly concurrent hashing.
func (*HashServer) Hash ¶
func (hs *HashServer) Hash(obj Hashable) string
Hash hashes the given object using the hash server. This can and should be called simultaneously from multiple goroutines for maximum performance.
type NotifyTimeoutInfo ¶
type NullableError ¶
type NullableError struct {
// contains filtered or unexported fields
}
NullableError is a thread-safe wrapper around an error that ensures an error has been explicitly set, regardless of value, before being checked.
func (*NullableError) Err ¶
func (ae *NullableError) Err() error
Err returns the error value stored in the NullableError. If the error has not been set using the Set method, this function will panic.
func (*NullableError) SetErr ¶
func (ae *NullableError) SetErr(err error)
SetErr sets the error value and allows Err to be called.
type PauseController ¶
type PauseController struct {
// contains filtered or unexported fields
}
PauseController is an embeddable helper struct that allows an object to provide a means to "pause" and "resume" itself.
func NewPauseController ¶
func NewPauseController(opts ...PauseControllerOption) *PauseController
NewPauseController creates and initializes a new pause controller.
func (*PauseController) CheckPaused ¶
func (p *PauseController) CheckPaused()
CheckPaused blocks while the paused state is active. The implementation should call CheckPaused before and/or after a "pausable" section of code to enable the pause functionality. When paused, all calls to CheckPaused will block until Resume is called, after which CheckPaused will not block until Pause is called again.
func (*PauseController) Pause ¶
func (p *PauseController) Pause()
Pause triggers an implementation-defined state where the object should cease its normal operations until unpaused.
func (*PauseController) Resume ¶
func (p *PauseController) Resume()
Resume removes the paused state and unblocks any blocked calls to CheckPaused.
type PauseControllerOption ¶
type PauseControllerOption func(*PauseControllerOptions)
func DefaultPaused ¶
func DefaultPaused(paused bool) PauseControllerOption
DefaultPaused starts the controller paused. This should be used place of simply calling Pause right away to prevent race conditions.
type PauseControllerOptions ¶
type PauseControllerOptions struct {
// contains filtered or unexported fields
}
func (*PauseControllerOptions) Apply ¶
func (o *PauseControllerOptions) Apply(opts ...PauseControllerOption)
type ZapfLogShim ¶
type ZapfLogShim struct {
ZapLogger *zap.SugaredLogger
}
ZapfLogShim implements the logr.Logger interface.
func (ZapfLogShim) Enabled ¶
func (lg ZapfLogShim) Enabled(level int) bool
func (ZapfLogShim) Error ¶
func (lg ZapfLogShim) Error(err error, msg string, keysAndValues ...interface{})
func (ZapfLogShim) Info ¶
func (lg ZapfLogShim) Info(level int, msg string, keysAndValues ...interface{})
func (ZapfLogShim) Init ¶
func (lg ZapfLogShim) Init(info logr.RuntimeInfo)
func (ZapfLogShim) WithValues ¶
func (lg ZapfLogShim) WithValues(keysAndValues ...interface{}) logr.LogSink