collect

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutofbandLoginError         model.CollectorError = "OutofbandLoginError"
	OutofbandInventoryError     model.CollectorError = "OutofbandInventoryError"
	OutofbandGetBiosConfigError model.CollectorError = "OutofbandGetBiosConfigError"
)

Variables

View Source
var (
	ErrCollectorKind = errors.New("invalid collector kind")
)
View Source
var (
	ErrConnect = errors.New("error connecting to BMC")
)

Functions

This section is empty.

Types

type Collector

type Collector interface {
	// InventoryRemote spawns an iterator that listens on the AssetCh and
	// collects inventory remotely (through its BMC) for each of the assets until the AssetCh is closed,
	// the collected inventory is then sent on the collector channel to be published.
	InventoryRemote(ctx context.Context) error

	// InventoryLocal collects and returns inventory and bios configuration on the local host for the given asset.
	InventoryLocal(ctx context.Context) (*model.Asset, error)

	// SetMockGetter sets a mock device inventory getter to be used for tests.
	SetMockGetter(getter interface{})
}

Collector interface defines methods to collect device inventory

func NewInbandCollector

func NewInbandCollector(alloy *app.App) Collector

New returns an inband inventory collector

func NewOutOfBandCollector

func NewOutOfBandCollector(alloy *app.App) Collector

NewOutOfBandCollector returns a instance of the OutOfBandCollector inventory collector

type InbandCollector

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

Inband collector collects hardware, firmware inventory inband

func (*InbandCollector) InventoryLocal

func (i *InbandCollector) InventoryLocal(ctx context.Context) (*model.Asset, error)

InventoryLocal implements the Collector interface to collect inventory and bios configuration locally (inband).

func (*InbandCollector) InventoryRemote

func (i *InbandCollector) InventoryRemote(_ context.Context) error

InventoryRemote implements is present here to satisfy the Collector interface.

func (*InbandCollector) SetMockGetter

func (i *InbandCollector) SetMockGetter(getter interface{})

type OutOfBandCollector

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

OutOfBand collector collects hardware, firmware inventory out of band

func (*OutOfBandCollector) InventoryLocal

func (o *OutOfBandCollector) InventoryLocal(_ context.Context) (*model.Asset, error)

InventoryLocal implements the Collector interface just to satisfy it.

func (*OutOfBandCollector) InventoryRemote

func (o *OutOfBandCollector) InventoryRemote(ctx context.Context) error

InventoryRemote iterates over assets received on the asset channel and collects inventory out-of-band (remotely) for the assets received, the collected inventory is then sent over the collector channel to the publisher.

This method returns after all the routines it dispatched (to the worker pool) have returned.

RunInventoryCollect implements the Collector interface.

nolint:gocyclo // this method is better not split up in its current form.

func (*OutOfBandCollector) SetMockGetter

func (o *OutOfBandCollector) SetMockGetter(getter interface{})

Jump to

Keyboard shortcuts

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