source

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// BootPath is where the /boot directory of the system to be inspected is located
	BootDir = HostDir(pathPrefix + "boot")
	// EtcPath is where the /etc directory of the system to be inspected is located
	EtcDir = HostDir(pathPrefix + "etc")
	// SysfsPath is where the /sys directory of the system to be inspected is located
	SysfsDir = HostDir(pathPrefix + "sys")
	// UsrPath is where the /usr directory of the system to be inspected is located
	UsrDir = HostDir(pathPrefix + "usr")
	// VarPath is where the /var directory of the system to be inspected is located
	VarDir = HostDir(pathPrefix + "var")
)

Functions

func GetAllConfigurableSources added in v0.10.0

func GetAllConfigurableSources() map[string]ConfigurableSource

GetAllConfigurableSources returns all registered configurable sources

func GetAllFeatureSources added in v0.10.0

func GetAllFeatureSources() map[string]FeatureSource

GetAllFeatureSources returns all registered label sources

func GetAllLabelSources added in v0.10.0

func GetAllLabelSources() map[string]LabelSource

GetAllLabelSources returns all registered label sources

func Register added in v0.10.0

func Register(s Source)

RegisterSource registers a source

Types

type Config added in v0.6.0

type Config interface {
}

Config is the generic interface for source configuration data

type ConfigurableSource added in v0.10.0

type ConfigurableSource interface {
	Source

	// NewConfig returns a new default config of the source
	NewConfig() Config

	// GetConfig returns the effective configuration of the source
	GetConfig() Config

	// SetConfig changes the effective configuration of the source
	SetConfig(Config)
}

ConfigurableSource is an interface for a source that can be configured

func GetConfigurableSource added in v0.10.0

func GetConfigurableSource(name string) ConfigurableSource

GetConfigurableSource a registered configurable source

type FeatureLabelValue added in v0.10.0

type FeatureLabelValue interface{}

FeatureLabelValue represents the value of one feature label

type FeatureLabels added in v0.10.0

type FeatureLabels map[string]FeatureLabelValue

FeatureLabels is a collection of feature labels

type FeatureSource

type FeatureSource interface {
	Source

	// Discover does feature discovery
	Discover() error

	// GetFeatures returns discovered features in raw form
	GetFeatures() *feature.DomainFeatures
}

FeatureSource is an interface for discovering node features

func GetFeatureSource added in v0.10.0

func GetFeatureSource(name string) FeatureSource

GetFeatureSource returns a registered FeatureSource interface

type HostDir added in v0.6.0

type HostDir string

HostDir is a helper for handling host system directories

func (HostDir) Path added in v0.6.0

func (d HostDir) Path(elem ...string) string

Path returns a full path to a file under HostDir

type LabelSource added in v0.10.0

type LabelSource interface {
	Source

	// GetLabels returns discovered feature labels
	GetLabels() (FeatureLabels, error)

	// Priority returns the priority of the source
	Priority() int
}

LabelSource represents a source of node feature labels

func GetLabelSource added in v0.10.0

func GetLabelSource(name string) LabelSource

GetLabelSource a registered label source

type MockLabelSource added in v0.10.0

type MockLabelSource struct {
	mock.Mock
}

MockLabelSource is an autogenerated mock type for the LabelSource type

func (*MockLabelSource) GetLabels added in v0.10.0

func (_m *MockLabelSource) GetLabels() (FeatureLabels, error)

GetLabels provides a mock function with given fields:

func (*MockLabelSource) Name added in v0.10.0

func (_m *MockLabelSource) Name() string

Name provides a mock function with given fields:

func (*MockLabelSource) Priority added in v0.10.0

func (_m *MockLabelSource) Priority() int

Priority provides a mock function with given fields:

type Source added in v0.10.0

type Source interface {
	// Name returns a friendly name for this source
	Name() string
}

Source is the base interface for all other source interfaces

type SupplementalSource added in v0.10.0

type SupplementalSource interface {
	Source

	// DisableByDefault returns true if the source should be disabled by
	// default in production.
	DisableByDefault() bool
}

SupplementalSource represents a source that does not belong to the core set sources to be used in production, e.g. is deprecated, very experimental or purposed for testing only.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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