Documentation ¶
Index ¶
- type PuntIdx
- func (p *PuntIdx) Clear()
- func (p *PuntIdx) GetMapping() idxvpp.NameToIdxRW
- func (p *PuntIdx) LookupIdx(name string) (idx uint32, metadata *PuntMetadata, exists bool)
- func (p *PuntIdx) LookupName(idx uint32) (name string, metadata *PuntMetadata, exists bool)
- func (p *PuntIdx) RegisterName(name string, idx uint32, ifMeta *PuntMetadata)
- func (p *PuntIdx) UnregisterName(name string) (idx uint32, metadata *PuntMetadata, exists bool)
- func (p *PuntIdx) UpdateMetadata(name string, metadata *PuntMetadata) (success bool)
- type PuntIndex
- type PuntIndexRW
- type PuntMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PuntIdx ¶
type PuntIdx struct {
// contains filtered or unexported fields
}
PuntIdx is type-safe implementation of mapping between punt indexes and names.
func (*PuntIdx) GetMapping ¶
func (p *PuntIdx) GetMapping() idxvpp.NameToIdxRW
GetMapping returns internal read-only mapping. It is used in tests to inspect the content of the PuntIdx.
func (*PuntIdx) LookupIdx ¶
func (p *PuntIdx) LookupIdx(name string) (idx uint32, metadata *PuntMetadata, exists bool)
LookupIdx looks up previously stored item identified by index in mapping.
func (*PuntIdx) LookupName ¶
func (p *PuntIdx) LookupName(idx uint32) (name string, metadata *PuntMetadata, exists bool)
LookupName looks up previously stored item identified by name in mapping.
func (*PuntIdx) RegisterName ¶
func (p *PuntIdx) RegisterName(name string, idx uint32, ifMeta *PuntMetadata)
RegisterName adds new item into name-to-index mapping.
func (*PuntIdx) UnregisterName ¶
func (p *PuntIdx) UnregisterName(name string) (idx uint32, metadata *PuntMetadata, exists bool)
UnregisterName removes an item identified by name from mapping
func (*PuntIdx) UpdateMetadata ¶
func (p *PuntIdx) UpdateMetadata(name string, metadata *PuntMetadata) (success bool)
UpdateMetadata updates metadata in existing punt entry.
type PuntIndex ¶
type PuntIndex 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 *PuntMetadata, exists bool) // LookupName looks up previously stored item identified by name in mapping. LookupName(idx uint32) (name string, metadata *PuntMetadata, exists bool) }
PuntIndex provides read-only access to mapping between punt registrations and punt names
type PuntIndexRW ¶
type PuntIndexRW interface { PuntIndex // RegisterName adds new item into name-to-index mapping. RegisterName(name string, idx uint32, puntMeta *PuntMetadata) // UnregisterName removes an item identified by name from mapping UnregisterName(name string) (idx uint32, metadata *PuntMetadata, exists bool) // UpdateMetadata updates metadata in existing punt entry. UpdateMetadata(name string, metadata *PuntMetadata) (success bool) // Clear removes all punt entries from the mapping. Clear() }
PuntIndexRW is mapping between software punt indexes and names.
func NewPuntIndex ¶
func NewPuntIndex(mapping idxvpp.NameToIdxRW) PuntIndexRW
NewPuntIndex creates new instance of PuntIndexRW.
type PuntMetadata ¶
PuntMetadata are custom metadata of the punt configuration