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 ¶
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 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)