Documentation ¶
Overview ¶
Package controller contains interfaces, structs, and functions that can be used to create shared controllers for managing clients, caches, and handlers for multiple types aka GroupVersionKinds.
Index ¶
- Variables
- type Controller
- type Handler
- type HandlerFunc
- type HandlerTransaction
- type Options
- type ResourceVersionGetter
- type SharedController
- type SharedControllerFactory
- func NewSharedControllerFactory(cacheFactory cache.SharedCacheFactory, opts *SharedControllerFactoryOptions) SharedControllerFactory
- func NewSharedControllerFactoryFromConfig(config *rest.Config, scheme *runtime.Scheme) (SharedControllerFactory, error)
- func NewSharedControllerFactoryFromConfigWithOptions(config *rest.Config, scheme *runtime.Scheme, ...) (SharedControllerFactory, error)
- func NewSharedControllerFactoryWithAgent(userAgent string, clientFactory SharedControllerFactory) SharedControllerFactory
- type SharedControllerFactoryOptions
- type SharedControllerHandler
- type SharedControllerHandlerFunc
- type SharedHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrIgnore = errors.New("ignore handler error")
)
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type HandlerFunc ¶
type HandlerTransaction ¶
func NewHandlerTransaction ¶
func NewHandlerTransaction(ctx context.Context) *HandlerTransaction
func (*HandlerTransaction) Commit ¶
func (h *HandlerTransaction) Commit()
func (*HandlerTransaction) Rollback ¶
func (h *HandlerTransaction) Rollback()
type Options ¶
type Options struct { RateLimiter workqueue.RateLimiter SyncOnlyChangedObjects bool }
type ResourceVersionGetter ¶
type ResourceVersionGetter interface {
GetResourceVersion() string
}
type SharedController ¶
type SharedController interface { Controller }
func NewSharedControllerWithAgent ¶
func NewSharedControllerWithAgent(userAgent string, controller SharedController) SharedController
type SharedControllerFactory ¶
type SharedControllerFactory interface {}
func NewSharedControllerFactory ¶
func NewSharedControllerFactory(cacheFactory cache.SharedCacheFactory, opts *SharedControllerFactoryOptions) SharedControllerFactory
func NewSharedControllerFactoryFromConfigWithOptions ¶
func NewSharedControllerFactoryFromConfigWithOptions(config *rest.Config, scheme *runtime.Scheme, opts *SharedControllerFactoryOptions) (SharedControllerFactory, error)
NewSharedControllerFactoryFromConfigWithOptions accepts options for configuring a new SharedControllerFactory and its cache.
func NewSharedControllerFactoryWithAgent ¶
func NewSharedControllerFactoryWithAgent(userAgent string, clientFactory SharedControllerFactory) SharedControllerFactory
NewSharedControllerFactoryWithAgent returns a controller factory that is equivalent to the passed controller factory with the addition that it will wrap the returned controllers from ForKind, ForResource, and ForResourceKind with the sharedController struct using the passed user agent.
type SharedControllerFactoryOptions ¶
type SharedControllerFactoryOptions struct { // This is intended to be used by applications with many objects and/or controllers types that have // alternative means of rerunning when necessary. When the informer's resync their cache the update // function is run. If this setting is enabled, when the update handler is triggered the overhead is // reduced but has the tradeoff of not rerunning handlers. Handlers that rely on external objects or // services, or experience a bug might need to rerun despite the respective object not changing. If this // is enabled, it is the responsibility of the app to ensure logic is retried when needed. The result is // that running the handler func on resync will mostly only serve the purpose of catching missed cache // events. SyncOnlyChangedObjects bool }
type SharedControllerHandler ¶
type SharedControllerHandler interface {
}type SharedHandler ¶
type SharedHandler struct {
// contains filtered or unexported fields
}
func (*SharedHandler) OnChange ¶
func (h *SharedHandler) OnChange(key string, obj runtime.Object) error
func (*SharedHandler) Register ¶
func (h *SharedHandler) Register(ctx context.Context, name string, handler SharedControllerHandler)
Click to show internal directories.
Click to hide internal directories.