inventory

package
v1.67.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasePatcher

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

BasePatcher will keep the common functionality of a patcher.

type EntityPatcher

type EntityPatcher struct {
	BasePatcher
	// contains filtered or unexported fields
}

func (*EntityPatcher) Reap

func (ep *EntityPatcher) Reap()

func (*EntityPatcher) Save

func (ep *EntityPatcher) Save(data types.PluginOutput) error

func (*EntityPatcher) Send

func (ep *EntityPatcher) Send() error

type Handler

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

Handler maintains the infrastructure inventory in an updated state. It will receive inventory data from integrations/plugins for processing deltas (differences between versions)

func NewInventoryHandler

func NewInventoryHandler(ctx context2.Context, cfg HandlerConfig, patcher Patcher) *Handler

NewInventoryHandler returns a new instances of an inventory.Handler.

func (*Handler) Handle

func (h *Handler) Handle(data types.PluginOutput)

Handle the inventory data from a plugin/integration.

func (*Handler) Start

func (h *Handler) Start()

Start will run the routines that periodically checks for deltas and submit them.

func (*Handler) Stop

func (h *Handler) Stop()

Stop will gracefully stop the inventory.Handler.

type HandlerConfig

type HandlerConfig struct {
	FirstReapInterval time.Duration
	ReapInterval      time.Duration
	SendInterval      time.Duration
	InventoryQueueLen int
}

type PatchSender

type PatchSender interface {
	Process() error
}

type PatchSenderProviderFunc

type PatchSenderProviderFunc func(entity.Entity) (PatchSender, error)

type Patcher

type Patcher interface {
	// Save will store the new data received from a plugin for future processing.
	Save(output types.PluginOutput) error

	// Reap will compare latest saved data with latest submitted and generate
	// deltas in storage if required.
	Reap()

	// Send will look for deltas in the storage and submit them to the backend.
	Send() error
}

Patcher performs the actions required to update the state of the inventory stored by the backend.

func NewEntityPatcher

func NewEntityPatcher(cfg PatcherConfig, deltaStore *delta.Store, patchSenderProviderFn PatchSenderProviderFunc) Patcher

type PatcherConfig

type PatcherConfig struct {
	IgnoredPaths         map[string]struct{}
	AgentEntity          entity.Entity
	RemoveEntitiesPeriod time.Duration
}

Jump to

Keyboard shortcuts

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