inventory

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDelta

func ComputeDelta(oldInv, newInv *schema.HostInventory, logger *logrus.Logger) *schema.HostDeltaInventory

ComputeDelta computes the difference between two HostInventory objects. It returns a HostDeltaInventory containing the changes. The delta includes added and removed packages, users, and other entities. It uses the hashMessage function to compare the objects efficiently.

func DebugProtoDiff

func DebugProtoDiff(oldMsg, newMsg proto.Message) string

DebugProtoDiff prints the difference between two proto messages

func DiffGenericByHash

func DiffGenericByHash[T proto.Message](
	oldList, newList []T,
	getKey func(T) string,
) (added, removed, changed []T)

DiffGenericByHash computes the difference between two lists of proto messages based on their hashes.

func IsDeltaEmpty

func IsDeltaEmpty(d *schema.HostDeltaInventory) bool

IsDeltaEmpty checks if the delta inventory is empty

func StableHash

func StableHash(msg proto.Message) uint64

StableHash return determinist hash from protobuf message

Types

type Builder

type Builder struct {
	Log *logrus.Logger
	Cfg options.RunOptions

	SystemGather *models.System

	Now    func() time.Time
	WhoAmI func() (string, error)
	Store  store.InventoryStore

	Platform            platform.PlatformCollector
	Packages            packages.PackagesCollector
	Applications        applications.ApplicationsCollector
	SystemServices      systemservices.SystemServicesCollector
	Networks            networks.NetworksCollector
	Users               users.UsersCollector
	Processes           process.ProcessCollector
	SSHInfos            ssh.SSHInfosCollector
	ComplianceReport    compliance.ComplianceCollector
	VulnerabilityReport vulnerability.VulnerabilityCollector
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(cfg options.RunOptions, systemGather *models.System, logger *logrus.Logger) (*Builder, error)

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) (*schema.HostInventory, error)

func (*Builder) ManageDelta

func (b *Builder) ManageDelta(fullInventory *schema.HostInventory) (*schema.InventoryRequest, *schema.HostInventory)

type HasResetUpdatedAt

type HasResetUpdatedAt interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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