interfacename

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package interfacename contains code implementing NetworkServiceServer and NetworkServiceClient to generate and set the name of the interface in the mechanism and the mechanism preferences of the requests

Index

Constants

View Source
const MAX_INTERFACE_NAME_LENGTH = 15

Variables

This section is empty.

Functions

func NewClient

func NewClient(prefix string, generator NameGenerator) networkservice.NetworkServiceClient

NewClient implements NetworkServiceClient to generate and add the interface name in the mechanism and mechanism preferences of the requests

func NewServer

func NewServer(prefix string, generator NameGenerator) networkservice.NetworkServiceServer

NewServer implements NetworkServiceServer to generate and add the interface name in the mechanism and mechanism preferences of the requests

Note: NSM v1.1.1 kernel.NewServer() interferes with interfaceNameServer. It has been decided to let NSM name the NSE side interfaces if possible.

Types

type CounterGenerator added in v0.7.0

type CounterGenerator struct {
	// contains filtered or unexported fields
}

func (*CounterGenerator) Generate added in v0.7.0

func (cg *CounterGenerator) Generate(prefix string, maxLength int) string

TODO: make sure the generated name is within range (probably the prefix length should be limited as well)

func (*CounterGenerator) Release added in v0.7.0

func (cg *CounterGenerator) Release(name string)

type NameGenerator

type NameGenerator interface {
	Generate(prefix string, maxLength int) string
	Release(name string)
}

type RandomGenerator

type RandomGenerator struct {
	// contains filtered or unexported fields
}

func (*RandomGenerator) Generate

func (rg *RandomGenerator) Generate(prefix string, maxLength int) string

TODO: make sure the generated name is within range (probably the prefix length should be limited as well)

func (*RandomGenerator) Release added in v0.7.0

func (rg *RandomGenerator) Release(name string)

Jump to

Keyboard shortcuts

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