Documentation ¶
Overview ¶
Package ifindex allows storing interface_types.InterfaceIndex stored in per Connection.Id metadata
Index ¶
- func Delete(ctx context.Context, isClient bool)
- func Load(ctx context.Context, isClient bool) (value interface_types.InterfaceIndex, ok bool)
- func LoadAndDelete(ctx context.Context, isClient bool) (value interface_types.InterfaceIndex, ok bool)
- func LoadOrStore(ctx context.Context, isClient bool, swIfIndex interface_types.InterfaceIndex) (value interface_types.InterfaceIndex, ok bool)
- func Store(ctx context.Context, isClient bool, swIfIndex interface_types.InterfaceIndex)
- type LoadInterfaceFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
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