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: 0

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