custom

package
v0.0.0-...-0117b6e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 12

Documentation

Overview

Package custom contains a gatherer for collecting custom inventory items

Index

Constants

View Source
const (
	// GathererName captures name of custom gatherer
	GathererName = "CustomInventory"
	// FileSuffix represents custom inventory file extension
	FileSuffix = ".json"
	// CustomInventoryTypeNamePrefix represents custom inventory typename prefix
	CustomInventoryTypeNamePrefix = "Custom:"
	// TypeNameLengthLimit represents custom inventory typename length limit
	TypeNameLengthLimit = 100
	// CustomInventoryCountLimit represents custom inventory type count limit
	CustomInventoryCountLimit = 20
	// AttributeCountLimit represents custom inventory entry's attribute count limit
	AttributeCountLimit = 50
	// AttributeNameLengthLimit represents custom inventory entry's attribute name length limit
	AttributeNameLengthLimit = 64
	// AttributeValueLengthLimit represents custom inventory entry's attribute value length limit
	AttributeValueLengthLimit = 4096
)

Variables

This section is empty.

Functions

func LogError

func LogError(log log.T, err error)

LogError is a wrapper on log.Error for easy testability

func ReadDir

func ReadDir(dirname string) ([]os.FileInfo, error)

ReadDir is a wrapper on ioutil.ReadDir for easy testability

func ReadFile

func ReadFile(filename string) ([]byte, error)

ReadFile is a wrapper on ioutil.ReadFile for easy testability

Types

type T

type T struct{}

T represents custom gatherer

func Gatherer

func Gatherer(context context.T) *T

Gatherer returns a new custom gatherer

func (*T) Name

func (t *T) Name() string

Name returns name of custom gatherer

func (*T) RequestStop

func (t *T) RequestStop() error

RequestStop stops the execution of custom gatherer

func (*T) Run

func (t *T) Run(context context.T, configuration model.Config) (items []model.Item, err error)

Run executes custom gatherer and returns list of inventory.Item

Jump to

Keyboard shortcuts

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