pluginstatusmap

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexPluginStatus

func IndexPluginStatus(data interface{}) map[string][]string

IndexPluginStatus creates indexes for Value. Index for State will be created

Types

type PluginStatusEvent

type PluginStatusEvent struct {
	idxmap.NamedMappingEvent
	Value *status.PluginStatus
}

PluginStatusEvent represents an item sent through watch channel in pluginStatusMap. In contrast to NameToIdxDto it contains 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 item identified by index in 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.

func NewPluginStatusMap

func NewPluginStatusMap(owner core.PluginName) PluginStatusIdxMap

NewPluginStatusMap is a constructor

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

Jump to

Keyboard shortcuts

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