inventory

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 32 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(opts ...Option) *DB

func (*DB) AddPodNetNs added in v0.7.0

func (db *DB) AddPodNetNs(pod string, netNsPath string)

func (*DB) GetDevice added in v0.7.0

func (db *DB) GetDevice(deviceName string) (resourceapi.Device, bool)

func (*DB) GetNetInterfaceName added in v0.7.0

func (db *DB) GetNetInterfaceName(deviceName string) (string, error)

GetNetInterfaceName returns the network interface name for a given device. It first attempts to retrieve the name from the local device store. If the device is not found, it triggers a rescan of the system's devices and retries the lookup. This can happen when a device was recently released by a previous pod and a scan had not happened yet. This ensures that the function can find newly added devices that were not present in the store at the time of the initial call.

func (*DB) GetPodNetNs added in v0.7.0

func (db *DB) GetPodNetNs(pod string) string

GetPodNamespace allows to get the Pod network namespace

func (*DB) GetResources

func (db *DB) GetResources(ctx context.Context) <-chan []resourceapi.Device

func (*DB) RemovePodNetNs added in v0.7.0

func (db *DB) RemovePodNetNs(pod string)

func (*DB) Run

func (db *DB) Run(ctx context.Context) error

type Option added in v0.9.0

type Option func(*DB)

func WithMaxPollInterval added in v0.9.0

func WithMaxPollInterval(d time.Duration) Option

func WithRateLimiter added in v0.9.0

func WithRateLimiter(limiter *rate.Limiter) Option

Jump to

Keyboard shortcuts

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