collector

package
v0.0.0-...-dcf9213 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBiosCfgCollect   = errors.New("error collecting BIOS configuration")
	ErrInventoryCollect = errors.New("error collecting inventory data")
)
View Source
var (
	ErrFetcherQuery = errors.New("error querying asset data from store")
)

Functions

This section is empty.

Types

type AssetIterCollector

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

AssetIterCollector holds attributes to iterate over the assets in the store repository and collect inventory, bios configuration for them remotely.

func NewAssetIterCollector

func NewAssetIterCollector(
	ctx context.Context,
	storeKind model.StoreKind,
	appKind model.AppKind,
	cfg *app.Configuration,
	syncWG *sync.WaitGroup,
	logger *logrus.Logger,
) (*AssetIterCollector, error)

NewAssetIterCollector is a constructor method that returns an AssetIterCollector.

func NewAssetIterCollectorWithStore

func NewAssetIterCollectorWithStore(
	appKind model.AppKind,
	repository store.Repository,
	concurrency int32,
	syncWG *sync.WaitGroup,
	logger *logrus.Logger,
) (*AssetIterCollector, error)

NewAssetIterCollectorWithStore is a constructor method that accepts an initialized store to return an AssetIterCollector.

func (*AssetIterCollector) Collect

func (d *AssetIterCollector) Collect(ctx context.Context)

Collect iterates over assets returned by the AssetIterator and collects their inventory, bios configuration data.

type AssetIterator

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

AssetIterator holds methods to recurse over assets in a store and return them over the asset channel.

func NewAssetIterator

func NewAssetIterator(repository store.Repository, logger *logrus.Logger) *AssetIterator

NewAssetIterator is a constructor method that returns an AssetIterator.

The returned AssetIterator will recurse over all assets in the store and send them over the asset channel, The caller of this method should invoke AssetChannel() to retrieve the channel to read assets from.

func (*AssetIterator) Channel

func (s *AssetIterator) Channel() <-chan *model.Asset

Channel returns the channel to read assets from when the fetcher is invoked through its Iter* method.

func (*AssetIterator) IterInBatches

func (s *AssetIterator) IterInBatches(ctx context.Context, batchSize int, pauser *Pauser)

IterInBatches queries the store for assets in batches, returning them over the assetCh

nolint:gocyclo // for now it makes sense to have the iter method logic in one method

type DeviceCollector

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

DeviceCollector holds attributes to collect inventory, bios configuration data from a single device.

func NewDeviceCollector

func NewDeviceCollector(ctx context.Context, storeKind model.StoreKind, appKind model.AppKind, cfg *app.Configuration, logger *logrus.Logger) (*DeviceCollector, error)

NewDeviceCollector is a constructor method to return a inventory, bios configuration data collector.

func NewDeviceCollectorWithStore

func NewDeviceCollectorWithStore(repository store.Repository, appKind model.AppKind, logger *logrus.Logger) (*DeviceCollector, error)

NewDeviceCollectorWithStore is a constructor method that accepts an initialized store repository - to return a inventory, bios configuration data collector.

func (*DeviceCollector) CollectInband

func (c *DeviceCollector) CollectInband(ctx context.Context, asset *model.Asset, outputStdout bool) error

CollectInband querys inventory and bios configuration data for a device through the host OS this expects Alloy is running within the alloy-inband docker image based on ironlib.

func (*DeviceCollector) CollectOutofband

func (c *DeviceCollector) CollectOutofband(ctx context.Context, asset *model.Asset, outputStdout bool) error

CollectOutofband querys inventory and bios configuration data for a device through its BMC.

type Pauser

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

func NewPauser

func NewPauser() *Pauser

func (*Pauser) Pause

func (p *Pauser) Pause()

func (*Pauser) UnPause

func (p *Pauser) UnPause()

func (*Pauser) Value

func (p *Pauser) Value() bool

Jump to

Keyboard shortcuts

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