Documentation ¶
Index ¶
- Constants
- func GetOrCreate(ctx context.Context, client kclient.Client, obj kclient.Object, ...) error
- func Key(namespace, name string) kclient.ObjectKey
- func StatusChanged(unmodified, newObj runtime.Object) bool
- type AddToSchemer
- type ErrorHandler
- type ErrorPrefix
- type FieldSelectorFilter
- type FinalizerHandler
- type Handler
- type HandlerFunc
- type HandlerSet
- type IgnoreNilHandler
- type IgnoreRemoveHandler
- type Middleware
- type NameNamespaceFilter
- type Request
- type Response
- type ResponseAttributes
- type ResponseWrapper
- type RouteBuilder
- func (r RouteBuilder) FieldSelector(sel fields.Selector) RouteBuilder
- func (r RouteBuilder) Finalize(finalizerID string, h Handler)
- func (r RouteBuilder) FinalizeFunc(finalizerID string, h HandlerFunc)
- func (r RouteBuilder) Handler(h Handler)
- func (r RouteBuilder) HandlerFunc(h HandlerFunc)
- func (r RouteBuilder) IncludeFinalizing() RouteBuilder
- func (r RouteBuilder) IncludeRemoved() RouteBuilder
- func (r RouteBuilder) Middleware(m ...Middleware) RouteBuilder
- func (r RouteBuilder) Name(name string) RouteBuilder
- func (r RouteBuilder) Namespace(namespace string) RouteBuilder
- func (r RouteBuilder) Selector(sel labels.Selector) RouteBuilder
- func (r RouteBuilder) Type(objType kclient.Object) RouteBuilder
- type Router
- type SelectorFilter
- type TriggerRegistry
Constants ¶
const ( TriggerPrefix = "_t " ReplayPrefix = "_r " )
Variables ¶
This section is empty.
Functions ¶
func GetOrCreate ¶
func StatusChanged ¶
Types ¶
type AddToSchemer ¶
type ErrorHandler ¶
ErrorHandler is a user defined function to handle an error. If the ErrorHandler returns nil this req is considered handled and will not be re-enqueued. If a non-nil resp is return this key will be re-enqueued. ErrorHandler will be call for nil errors also so That the ErrorHandler can possibly clear a previous error state.
type ErrorPrefix ¶
type ErrorPrefix struct { Next Handler // contains filtered or unexported fields }
type FieldSelectorFilter ¶
type FinalizerHandler ¶
type HandlerFunc ¶
type HandlerSet ¶
type HandlerSet struct {
// contains filtered or unexported fields
}
func NewHandlerSet ¶
func (*HandlerSet) AddHandler ¶
func (m *HandlerSet) AddHandler(objType kclient.Object, handler Handler)
func (*HandlerSet) WatchGVK ¶
func (m *HandlerSet) WatchGVK(gvks ...schema.GroupVersionKind) error
type IgnoreNilHandler ¶
type IgnoreNilHandler struct {
Next Handler
}
type IgnoreRemoveHandler ¶
type IgnoreRemoveHandler struct {
Next Handler
}
type Middleware ¶
type NameNamespaceFilter ¶
type Request ¶
type Request struct { Client kclient.WithWatch Object kclient.Object Ctx context.Context GVK schema.GroupVersionKind Namespace string Name string Key string FromTrigger bool }
func (*Request) List ¶
func (r *Request) List(object kclient.ObjectList, opts *kclient.ListOptions) error
type ResponseAttributes ¶
type ResponseAttributes struct {
// contains filtered or unexported fields
}
func (*ResponseAttributes) Attributes ¶
func (r *ResponseAttributes) Attributes() map[string]any
type ResponseWrapper ¶
type ResponseWrapper struct { NoPrune bool Delay time.Duration Objs []kclient.Object Attr map[string]any }
func (*ResponseWrapper) Attributes ¶
func (r *ResponseWrapper) Attributes() map[string]any
func (*ResponseWrapper) DisablePrune ¶
func (r *ResponseWrapper) DisablePrune()
func (*ResponseWrapper) Objects ¶
func (r *ResponseWrapper) Objects(obj ...kclient.Object)
func (*ResponseWrapper) RetryAfter ¶
func (r *ResponseWrapper) RetryAfter(delay time.Duration)
type RouteBuilder ¶
type RouteBuilder struct {
// contains filtered or unexported fields
}
func (RouteBuilder) FieldSelector ¶
func (r RouteBuilder) FieldSelector(sel fields.Selector) RouteBuilder
func (RouteBuilder) Finalize ¶
func (r RouteBuilder) Finalize(finalizerID string, h Handler)
func (RouteBuilder) FinalizeFunc ¶
func (r RouteBuilder) FinalizeFunc(finalizerID string, h HandlerFunc)
func (RouteBuilder) Handler ¶
func (r RouteBuilder) Handler(h Handler)
func (RouteBuilder) HandlerFunc ¶
func (r RouteBuilder) HandlerFunc(h HandlerFunc)
func (RouteBuilder) IncludeFinalizing ¶
func (r RouteBuilder) IncludeFinalizing() RouteBuilder
func (RouteBuilder) IncludeRemoved ¶
func (r RouteBuilder) IncludeRemoved() RouteBuilder
func (RouteBuilder) Middleware ¶
func (r RouteBuilder) Middleware(m ...Middleware) RouteBuilder
func (RouteBuilder) Name ¶
func (r RouteBuilder) Name(name string) RouteBuilder
func (RouteBuilder) Namespace ¶
func (r RouteBuilder) Namespace(namespace string) RouteBuilder
func (RouteBuilder) Selector ¶
func (r RouteBuilder) Selector(sel labels.Selector) RouteBuilder
func (RouteBuilder) Type ¶
func (r RouteBuilder) Type(objType kclient.Object) RouteBuilder
type Router ¶
type Router struct { RouteBuilder OnErrorHandler ErrorHandler // contains filtered or unexported fields }
func New ¶
func New(handlerSet *HandlerSet, electionConfig *leader.ElectionConfig, healthzPort int) *Router
New returns a new *Router with given HandlerSet and ElectionConfig. Passing a nil ElectionConfig is valid and results in no leader election for the router. The healthzPort is the port on which the healthz endpoint will be served. If <= 0, the healthz endpoint will not be served. When creating multiple routers, the first router created with a positive healthzPort will be used. The healthz endpoint is served on /healthz, and will not be started until the router is started.
func (*Router) HandleFunc ¶
func (r *Router) HandleFunc(objType kclient.Object, h HandlerFunc)