Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClusterObjectKey ¶
func DefaultDifferFilter ¶
func DefaultDifferFilter(knownClusterSet sets.String) func(obj ClusterObject) bool
Types ¶
type ClusterObject ¶
func (ClusterObject) GetOwnerCluster ¶
func (c ClusterObject) GetOwnerCluster() string
type Differ ¶
type Differ interface { Insert(object ...ClusterObject) Has(object ClusterObject) bool Get(key string) ClusterObject Len() int Delete(object ClusterObject) Clear() GetKeys() sets.String // Difference compute the different keys between caller and callee. // receive a handler and execute to keep consistent with caller. Difference(Differ, Handler) }
func NewDiffSet ¶
func NewDiffSet(objects ...ClusterObject) Differ
type FilteringHandler ¶
type FilteringHandler struct { FilterFunc func(obj ClusterObject) bool Handler Handler }
FilteringHandler applies the provided filter to all events coming in. If any object match the filter, will skip this func.
func (FilteringHandler) OnAdd ¶
func (h FilteringHandler) OnAdd(obj ClusterObject)
OnAdd calls the nested handler only if the filter succeeds
func (FilteringHandler) OnDelete ¶
func (h FilteringHandler) OnDelete(obj ClusterObject)
OnDelete calls the nested handler only if the filter succeeds
func (FilteringHandler) OnUpdate ¶
func (h FilteringHandler) OnUpdate(obj1, obj2 ClusterObject)
OnUpdate calls the nested handler only if both match the filter.
type Handler ¶
type Handler interface { OnAdd(obj ClusterObject) OnDelete(obj ClusterObject) OnUpdate(obj1, obj2 ClusterObject) }
type HandlerFuncs ¶
type HandlerFuncs struct { AddFunc func(obj ClusterObject) DeleteFunc func(obj ClusterObject) UpdateFunc func(obj1, obj2 ClusterObject) }
HandlerFuncs is an adaptor to let you easily specify as many or as few of the handle functions as you want while still implementing Handler.
func (HandlerFuncs) OnAdd ¶
func (h HandlerFuncs) OnAdd(obj ClusterObject)
OnAdd calls AddFunc if it's not nil.
func (HandlerFuncs) OnDelete ¶
func (h HandlerFuncs) OnDelete(obj ClusterObject)
OnDelete calls DeleteFunc if it's not nil.
func (HandlerFuncs) OnUpdate ¶
func (h HandlerFuncs) OnUpdate(obj1, obj2 ClusterObject)
OnUpdate calls UpdateFunc if it's not nil.
Click to show internal directories.
Click to hide internal directories.