handlemgr

package
v0.0.0-...-d216c5d Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleManager

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

func NewHandleManager

func NewHandleManager(featureDetector environment.FeatureDetectorIface, opts ...NetlinkHandleManagerOpt) *HandleManager

func (*HandleManager) Handle

func (r *HandleManager) Handle() (netlinkshim.Interface, error)

Handle returns the cached netlink handle, initialising it if needed.

func (*HandleManager) MarkHandleForReopen

func (r *HandleManager) MarkHandleForReopen()

MarkHandleForReopen ensures that the next call to Handle() will open a fresh handle. The current handle is not closed immediately, it will be closed when the new handle is opened.

We used to close the handle immediately but that led to bugs where the caller wouldn't refresh its handle until the next time around its loop.

type NetlinkHandleManagerOpt

type NetlinkHandleManagerOpt func(*HandleManager)

func WithNewHandleOverride

func WithNewHandleOverride(newNetlinkHandle func() (netlinkshim.Interface, error)) NetlinkHandleManagerOpt

func WithSocketTimeout

func WithSocketTimeout(d time.Duration) NetlinkHandleManagerOpt

func WithStrictModeOverride

func WithStrictModeOverride(strictEnabled bool) NetlinkHandleManagerOpt

Jump to

Keyboard shortcuts

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