source

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 GetAllFeatures added in v0.12.0

func GetAllFeatures() *nfdv1alpha1.Features

GetAllFeatures returns a combined set of all features from all feature 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)

Register 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() *nfdv1alpha1.Features
}

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 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 NewMockLabelSource added in v0.12.0

func NewMockLabelSource(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockLabelSource

NewMockLabelSource creates a new instance of MockLabelSource. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

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
api

Jump to

Keyboard shortcuts

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