searcher

package
v2.1.67 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Condition IDC key.
	ConditionIDC = "idc"

	// Condition location key.
	ConditionLocation = "location"
)

Variables

This section is empty.

Functions

func Evaluate added in v2.0.1

func Evaluate(ip, hostname string, conditions map[string]string, scopes Scopes, cluster models.SchedulerCluster, log *zap.SugaredLogger) float64

Evaluate the degree of matching between scheduler cluster and dfdaemon.

func FilterSchedulerClusters added in v2.0.2

func FilterSchedulerClusters(conditions map[string]string, schedulerClusters []models.SchedulerCluster) []models.SchedulerCluster

Filter the scheduler clusters that dfdaemon can be used.

Types

type Scopes

type Scopes struct {
	IDC       string   `mapstructure:"idc"`
	Location  string   `mapstructure:"location"`
	CIDRs     []string `mapstructure:"cidrs"`
	Hostnames []string `mapstructure:"hostnames"`
}

Scheduler cluster scopes.

type Searcher

type Searcher interface {
	// FindSchedulerClusters finds scheduler clusters that best matches the evaluation.
	FindSchedulerClusters(ctx context.Context, schedulerClusters []models.SchedulerCluster, ip, hostname string,
		conditions map[string]string, log *zap.SugaredLogger) ([]models.SchedulerCluster, error)
}

func LoadPlugin

func LoadPlugin(dir string) (Searcher, error)

func New

func New(pluginDir string) Searcher

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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