nsidx

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package nsidx implements name-to-index mapping registry and cache for app namespaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppNsIndex

type AppNsIndex interface {
	// GetMapping returns internal read-only mapping with metadata of type interface{}.
	GetMapping() idxvpp.NameToIdxRW

	// LookupIdx looks up previously stored item identified by index in mapping.
	LookupIdx(name string) (idx uint32, metadata *l4.AppNamespaces_AppNamespace, exists bool)

	// LookupName looks up previously stored item identified by name in mapping.
	LookupName(idx uint32) (name string, metadata *l4.AppNamespaces_AppNamespace, exists bool)

	// LookupNamesByInterface returns names of items that contains given IP address in metadata
	LookupNamesByInterface(ifName string) []*l4.AppNamespaces_AppNamespace

	// WatchNameToIdx allows to subscribe for watching changes in appNsIndex mapping
	WatchNameToIdx(subscriber core.PluginName, pluginChannel chan ChangeDto)
}

AppNsIndex provides read-only access to mapping between indexes (used internally in VPP) and AppNamespace indexes.

type AppNsIndexRW

type AppNsIndexRW interface {
	AppNsIndex

	// RegisterName adds new item into name-to-index mapping.
	RegisterName(name string, idx uint32, metadata *l4.AppNamespaces_AppNamespace)

	// UnregisterName removes an item identified by name from mapping
	UnregisterName(name string) (idx uint32, metadata *l4.AppNamespaces_AppNamespace, exists bool)
}

AppNsIndexRW is mapping between indexes (used internally in VPP) and AppNamespace indexes.

func NewAppNsIndex

func NewAppNsIndex(mapping idxvpp.NameToIdxRW) AppNsIndexRW

NewAppNsIndex creates new instance of appNsIndex.

type ChangeDto

type ChangeDto struct {
	idxvpp.NameToIdxDtoWithoutMeta
	Metadata *l4.AppNamespaces_AppNamespace
}

ChangeDto represents an item sent through watch channel in appNsIndex. In contrast to NameToIdxDto it contains typed metadata.

Jump to

Keyboard shortcuts

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