Documentation ¶
Index ¶
- func DefaultObjectValue(obj client.Object) any
- func Handler(name string, handler handler.EventHandler, opts ...HandlerOption) handler.EventHandler
- func Predicate(name string, prct predicate.Predicate, opts ...PredicateOption) predicate.Predicate
- type HandlerOption
- type HandlerOptions
- type PredicateOption
- type PredicateOptions
- type WithLog
- type WithObjectValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultObjectValue ¶
DefaultObjectValue provides object logging values by using klog.KObj.
func Handler ¶
func Handler(name string, handler handler.EventHandler, opts ...HandlerOption) handler.EventHandler
Handler allows debugging a handler.EventHandler by wrapping it and logging each action it does.
Caution: This has a heavy toll on runtime performance and should *not* be used in production code. Use only for debugging handlers and remove once done.
Types ¶
type HandlerOption ¶
type HandlerOption interface {
ApplyToHandler(o *HandlerOptions)
}
type HandlerOptions ¶
type HandlerOptions struct { // Log is the logger to use. If unspecified, the debug package logger will be used. Log logr.Logger // ObjectValue controls how an object will be represented as in the log values. ObjectValue func(client.Object) any }
HandlerOptions are options for construction a debug handler.
func (*HandlerOptions) ApplyOptions ¶
func (o *HandlerOptions) ApplyOptions(opts []HandlerOption) *HandlerOptions
type PredicateOption ¶
type PredicateOption interface {
ApplyToPredicate(o *PredicateOptions)
}
type PredicateOptions ¶
type PredicateOptions struct { // Log is the logger to use. If unspecified, the debug package logger will be used. Log logr.Logger // ObjectValue controls how an object will be represented as in the log values. ObjectValue func(client.Object) any }
PredicateOptions are options for construction a debug predicate.
func (*PredicateOptions) ApplyOptions ¶
func (o *PredicateOptions) ApplyOptions(opts []PredicateOption) *PredicateOptions
func (*PredicateOptions) ApplyToPredicate ¶
func (o *PredicateOptions) ApplyToPredicate(o2 *PredicateOptions)
type WithLog ¶
WithLog specifies the logger to use.
func (WithLog) ApplyToHandler ¶
func (w WithLog) ApplyToHandler(o *HandlerOptions)
func (WithLog) ApplyToPredicate ¶
func (w WithLog) ApplyToPredicate(o *PredicateOptions)
type WithObjectValue ¶
WithObjectValue specifies the function to log an client.Object's value with.
func (WithObjectValue) ApplyToHandler ¶
func (w WithObjectValue) ApplyToHandler(o *HandlerOptions)
func (WithObjectValue) ApplyToPredicate ¶
func (w WithObjectValue) ApplyToPredicate(o *PredicateOptions)
Click to show internal directories.
Click to hide internal directories.