source

package
v0.0.0-...-22d9994 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllConfigurableSources

func GetAllConfigurableSources() map[string]ConfigurableSource

GetAllConfigurableSources returns all registered configurable sources

func GetAllFeatureSources

func GetAllFeatureSources() map[string]FeatureSource

GetAllFeatureSources returns all registered label sources

func GetAllFeatures

func GetAllFeatures() *nfdv1alpha1.Features

GetAllFeatures returns a combined set of all features from all feature sources.

func GetAllLabelSources

func GetAllLabelSources() map[string]LabelSource

GetAllLabelSources returns all registered label sources

func Register

func Register(s Source)

Register registers a source.

Types

type Config

type Config interface {
}

Config is the generic interface for source configuration data

type ConfigurableSource

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

func GetConfigurableSource(name string) ConfigurableSource

GetConfigurableSource a registered configurable source

type FeatureLabelValue

type FeatureLabelValue interface{}

FeatureLabelValue represents the value of one feature label

type FeatureLabels

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

func GetFeatureSource(name string) FeatureSource

GetFeatureSource returns a registered FeatureSource interface

type LabelSource

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

func GetLabelSource(name string) LabelSource

GetLabelSource a registered label source

type MockLabelSource

type MockLabelSource struct {
	mock.Mock
}

MockLabelSource is an autogenerated mock type for the LabelSource type

func NewMockLabelSource

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

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

GetLabels provides a mock function with given fields:

func (*MockLabelSource) Name

func (_m *MockLabelSource) Name() string

Name provides a mock function with given fields:

func (*MockLabelSource) Priority

func (_m *MockLabelSource) Priority() int

Priority provides a mock function with given fields:

type Source

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

Source is the base interface for all other source interfaces

type TestSource

type TestSource interface {
	Source

	// IsTestSource returns true if the source is not for production
	IsTestSource() bool
}

TestSource represents a source 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