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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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