asset

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: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SourceKindCSV identifies a csv asset source
	SourceKindCSV = "csv"
)
View Source
const (

	// SourceKindServerService identifies a server service source.
	SourceKindServerService = "serverService"
)

Variables

View Source
var (
	ErrGetter        = errors.New("asset getter error")
	ErrConfig        = errors.New("required config not set")
	ErrAssetNotFound = errors.New("asset not found")
)
View Source
var (

	// ErrServerServiceQuery is returned when a server service query fails.
	ErrServerServiceQuery = errors.New("serverService query error")
	// ErrServerServiceObject is returned when a server service object is found to be missing attributes.
	ErrServerServiceObject = errors.New("serverService object error")
)
View Source
var (
	ErrCSVSource = errors.New("error in CSV")
)

Functions

This section is empty.

Types

type Getter

type Getter interface {
	// All runs the asset getter which retrieves all assets in the inventory store and sends them over the asset channel.
	ListAll(ctx context.Context) error

	// ByIDs runs the asset getter which retrieves all assets based on the list of IDs and sends them over the asset channel.
	ListByIDs(ctx context.Context, assetIDs []string) error

	// AssetByID returns one asset from the inventory identified by its identifier.
	AssetByID(ctx context.Context, assetID string, fetchBmcCredentials bool) (*model.Asset, error)

	// SetClient sets the given client as the Getter client to enable mocking for tests.
	SetClient(interface{})
}

Getter interface declares methods to be implemented for asset retrieval from the asset store.

func NewCSVGetter

func NewCSVGetter(_ context.Context, alloy *app.App, csvReader io.ReadCloser) (Getter, error)

NewCSVGetter returns a new csv asset getter to retrieve asset information from a CSV file for inventory collection.

func NewServerServiceGetter

func NewServerServiceGetter(ctx context.Context, alloy *app.App) (Getter, error)

NewServerServiceGetter returns an asset getter to retrieve asset information from serverService for inventory collection.

Jump to

Keyboard shortcuts

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