nsidx

package
v1.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 3 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

	// ListNames returns all names in the mapping.
	ListNames() (names []string)

	// WatchNameToIdx allows to subscribe for watching changes in appNsIndex mapping
	WatchNameToIdx(subscriber string, 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)

	// Clear removes all ACL entries from the mapping.
	Clear()
}

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