loopback

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Overview

Package loopback provides networkservice.NetworkService chain elements for creating loopback interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, isClient bool)

Delete deletes the swIfIndex stored in per Connection.Id metadata

func Load

func Load(ctx context.Context, isClient bool) (value interface_types.InterfaceIndex, ok bool)

Load returns the swIfIndex stored in per Connection.Id metadata, or nil if no value is present. The ok result indicates whether value was found in the per Connection.Id metadata.

func LoadAndDelete

func LoadAndDelete(ctx context.Context, isClient bool) (value interface_types.InterfaceIndex, ok bool)

LoadAndDelete deletes the swIfIndex stored in per Connection.Id metadata, returning the previous value if any. The loaded result reports whether the key was present.

func LoadOrStore

func LoadOrStore(ctx context.Context, isClient bool, swIfIndex interface_types.InterfaceIndex) (value interface_types.InterfaceIndex, ok bool)

LoadOrStore returns the existing swIfIndex stored in per Connection.Id metadata if present. Otherwise, it stores and returns the given swIfIndex. The loaded result is true if the value was loaded, false if stored.

func NewClient

func NewClient(vppConn api.Connection, opts ...Option) networkservice.NetworkServiceClient

NewClient creates a NetworkServiceClient chain element to create the loopback vpp-interface

func NewServer

func NewServer(vppConn api.Connection, opts ...Option) networkservice.NetworkServiceServer

NewServer creates a NetworkServiceServer chain element to create the loopback vpp-interface

func Store

func Store(ctx context.Context, isClient bool, swIfIndex interface_types.InterfaceIndex)

Store sets the loopback swIfIndex stored in per Connection.Id metadata.

Types

type Map

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

Map stores loopback swIfIndex by NetworkServiceName

func NewMap

func NewMap() *Map

NewMap creates loopback map

type Option

type Option func(o *options)

Option is an option pattern for loopbackClient/Server

func WithSharedMap

func WithSharedMap(l *Map) Option

WithSharedMap - sets shared loopback map. It may be needed for sharing Map between client and server

Jump to

Keyboard shortcuts

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