Documentation ¶
Overview ¶
Package pluginstatusmap implements specialization of idxmap used to store plugin status by plugin name.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexPluginStatus ¶
IndexPluginStatus creates indexes for plugin states and records the state passed as untyped data.
Types ¶
type PluginStatusEvent ¶
type PluginStatusEvent struct { idxmap.NamedMappingEvent Value *status.PluginStatus }
PluginStatusEvent represents an item sent through the watch channel in PluginStatusMap.WatchNameToIdx(). In contrast to NameToIdxDto it contains a typed Value.
type PluginStatusIdxMap ¶
type PluginStatusIdxMap interface { // GetMapping returns internal read-only mapping with Value // of type interface{}. GetMapping() idxmap.NamedMapping // GetValue looks up previously stored status by plugin name in the mapping. GetValue(pluginName string) (data *status.PluginStatus, exists bool) // WatchNameToIdx allows to subscribe for watching changes in pluginStatusMap // mapping. WatchNameToIdx(subscriber core.PluginName, pluginChannel chan PluginStatusEvent) }
PluginStatusIdxMap provides map of plugin names to plugin status. Other plugins can watch changes to this map.
type PluginStatusIdxMapRW ¶
type PluginStatusIdxMapRW interface { PluginStatusIdxMap // RegisterName adds new item into name-to-index mapping. Put(pluginName string, pluginStatus *status.PluginStatus) // UnregisterName removes an item identified by name from mapping Delete(pluginName string) (data *status.PluginStatus, exists bool) }
PluginStatusIdxMapRW exposes not only PluginStatusIdxMap but also write methods.
func NewPluginStatusMap ¶
func NewPluginStatusMap(owner core.PluginName) PluginStatusIdxMapRW
NewPluginStatusMap is a constructor for PluginStatusIdxMapRW.
Click to show internal directories.
Click to hide internal directories.