informer

package
v0.3.10-0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2022 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWatchManagerBySessionBg

func NewWatchManagerBySessionBg(session *mcclient.ClientSession, callback func(man *SWatchManager) error)

Types

type EventHandler

type EventHandler interface {
	OnAdd(obj *jsonutils.JSONDict)
	OnUpdate(oldObj, newObj *jsonutils.JSONDict)
	OnDelete(obj *jsonutils.JSONDict)
}

type EventHandlerFuncs

type EventHandlerFuncs struct {
	AddFunc    func(obj *jsonutils.JSONDict)
	UpdateFunc func(oldObj, newObj *jsonutils.JSONDict)
	DeleteFunc func(obj *jsonutils.JSONDict)
}

func (EventHandlerFuncs) OnAdd

func (r EventHandlerFuncs) OnAdd(obj *jsonutils.JSONDict)

func (EventHandlerFuncs) OnDelete

func (r EventHandlerFuncs) OnDelete(obj *jsonutils.JSONDict)

func (EventHandlerFuncs) OnUpdate

func (r EventHandlerFuncs) OnUpdate(oldObj, newObj *jsonutils.JSONDict)

type FilteringEventHandler

type FilteringEventHandler struct {
	FilterFunc func(obj *jsonutils.JSONDict) bool
	Handler    EventHandler
}

func (FilteringEventHandler) OnAdd

func (FilteringEventHandler) OnDelete

func (r FilteringEventHandler) OnDelete(obj *jsonutils.JSONDict)

func (FilteringEventHandler) OnUpdate

func (r FilteringEventHandler) OnUpdate(oldObj, newObj *jsonutils.JSONDict)

type IResourceManager

type IResourceManager interface {
	KeyString() string
	GetKeyword() string
}

type IWatcher

type IWatcher interface {
	AddEventHandler(ctx context.Context, handler EventHandler) error
}

type SWatchManager

type SWatchManager struct {
	// contains filtered or unexported fields
}

func NewWatchManager

func NewWatchManager(client *mcclient.Client, token mcclient.TokenCredential, region, interfaceType string) (*SWatchManager, error)

func NewWatchManagerBySession

func NewWatchManagerBySession(session *mcclient.ClientSession) (*SWatchManager, error)

func (*SWatchManager) For

func (man *SWatchManager) For(resMan IResourceManager) IWatcher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL