Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base implements basic functions for controllers.
func (*Base) RemoveHook ¶
RemoveHook removes given hook from the controller.
type Controller ¶
type Controller interface { // Run starts the controller listening on custom resource changes. Run(ctx context.Context) error // AddHook allows to inject new hook into the controller. AddHook(hook Hook) error // RemoveHook removes hook from the controller. RemoveHook(hook Hook) error }
Controller is base type for all custom resource controllers.
type Event ¶
type Event struct { Type EventType Object interface{} }
Event represents event processed by the controller.
type EventsHook ¶
EventsHook extends `Hook`. All processed events are published to the events channel.
func NewEventsHook ¶
func NewEventsHook(channelSize int) EventsHook
NewEventsHook returns a new EventsHook with channel with the capacity of channelSize.
type Hook ¶
type Hook interface { // OnAdd runs after the controller finishes processing the added object. OnAdd(object interface{}) // OnUpdate runs after the controller finishes processing the updated object. OnUpdate(object interface{}) // OnDelete runs after the controller finishes processing the deleted object. OnDelete(object interface{}) }
Hook represents actions that can be injected into the controller.
Click to show internal directories.
Click to hide internal directories.