Documentation ¶
Index ¶
- func DefaultStoreIndexFunc(obj interface{}) ([]string, error)
- func DefaultStoreIndexers() cache.Indexers
- func MetaNamespaceKeyFunc(obj interface{}) (string, error)
- type ExplicitKey
- type Informer
- type Lister
- type PipelineEventHandler
- type PipelineFilterHandler
- type PipelineTaskEventHandlerFuncs
- type Recorder
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultStoreIndexFunc ¶
DefaultStoreIndexFunc todo
func MetaNamespaceKeyFunc ¶
MetaNamespaceKeyFunc is a convenient default KeyFunc which knows how to make keys for API objects which implement meta.Interface. The key uses the format <namespace>/<name> unless <namespace> is empty, then it's just <name>.
TODO: replace key-as-string with a key-as-struct so that this packing/unpacking won't be necessary.
Types ¶
type ExplicitKey ¶
type ExplicitKey string
ExplicitKey can be passed to MetaNamespaceKeyFunc if you have the key for the object but not the object itself.
type Informer ¶
type Informer interface { Watcher() Watcher Lister() Lister Recorder() Recorder GetStore() cache.Store }
Informer 负责事件通知
type Lister ¶
type Lister interface {
List(ctx context.Context, opts *pipeline.QueryPipelineOptions) (*pipeline.PipelineSet, error)
}
type PipelineEventHandler ¶
type PipelineEventHandler interface { OnAdd(obj *pipeline.Pipeline) OnUpdate(old, new *pipeline.Pipeline) OnDelete(obj *pipeline.Pipeline) }
PipelineEventHandler can handle notifications for events that happen to a resource. The events are informational only, so you can't return an error.
- OnAdd is called when an object is added.
- OnUpdate is called when an object is modified. Note that oldObj is the last known state of the object-- it is possible that several changes were combined together, so you can't use this to see every single change. OnUpdate is also called when a re-list happens, and it will get called even if nothing changed. This is useful for periodically evaluating or syncing something.
- OnDelete will get the final state of the item if it is known, otherwise it will get an object of type DeletedFinalStateUnknown. This can happen if the watch is closed and misses the delete event and we don't notice the deletion until the subsequent re-list.
type PipelineFilterHandler ¶
type PipelineTaskEventHandlerFuncs ¶
type PipelineTaskEventHandlerFuncs struct { AddFunc func(obj *pipeline.Pipeline) UpdateFunc func(oldObj, newObj *pipeline.Pipeline) DeleteFunc func(obj *pipeline.Pipeline) }
PipelineEventHandlerFuncs is an adaptor to let you easily specify as many or as few of the notification functions as you want while still implementing ResourceEventHandler.
func (PipelineTaskEventHandlerFuncs) OnAdd ¶
func (r PipelineTaskEventHandlerFuncs) OnAdd(obj *pipeline.Pipeline)
OnAdd calls AddFunc if it's not nil.
func (PipelineTaskEventHandlerFuncs) OnDelete ¶
func (r PipelineTaskEventHandlerFuncs) OnDelete(obj *pipeline.Pipeline)
OnDelete calls DeleteFunc if it's not nil.
func (PipelineTaskEventHandlerFuncs) OnUpdate ¶
func (r PipelineTaskEventHandlerFuncs) OnUpdate(oldObj, newObj *pipeline.Pipeline)
OnUpdate calls UpdateFunc if it's not nil.
type Watcher ¶
type Watcher interface { // Run starts and runs the shared informer, returning after it stops. // The informer will be stopped when stopCh is closed. Run(ctx context.Context) error // AddEventHandler adds an event handler to the shared informer using the shared informer's resync // period. Events to a single handler are delivered sequentially, but there is no coordination // between different handlers. AddPipelineTaskEventHandler(handler PipelineEventHandler) }
Watcher 负责事件通知