ifindex

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: 3 Imported by: 0

Documentation

Overview

Package ifindex allows storing interface_types.InterfaceIndex stored in per Connection.Id metadata

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, isClient bool)

Delete deletes the interface_types.InterfaceIndex stored in per Connection.Id metadata

func Load

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

Load returns the interface_types.InterfaceIndex 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 interface_types.InterfaceIndex 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 interface_types.InterfaceIndex stored in per Connection.Id metadata if present. Otherwise, it stores and returns the given nterface_types.InterfaceIndex. The loaded result is true if the value was loaded, false if stored.

func Store

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

Store sets the interface_types.InterfaceIndex stored in per Connection.Id metadata.

Types

type LoadInterfaceFn added in v1.3.0

type LoadInterfaceFn = func(ctx context.Context, isClient bool) (value interface_types.InterfaceIndex, ok bool)

LoadInterfaceFn is alias for function that loads interface from index

Jump to

Keyboard shortcuts

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