score

package
v0.0.0-...-b7b0d94 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package score exports an api.ScorePlugin to the host. Only import this package when setting Plugin, as doing otherwise will cause overhead.

Index

Constants

View Source
const (
	// MaxNodeScore is the maximum score a Score plugin is expected to return.
	MaxNodeScore int64 = 100
)

Variables

This section is empty.

Functions

func SetPlugin

func SetPlugin(scorePlugin api.ScorePlugin)

SetPlugin should be called in `main` to assign an api.ScorePlugin instance.

For example:

func main() {
	score.SetPlugin(scorePlugin{})
}

type scorePlugin struct{}

func (scorePlugin) Score(state api.CycleState, pod api.Pod, nodeName string) (score int32, status *api.Status) {
	panic("implement me")
}

Note: If you need state, you can assign it with prescore.SetPlugin.

Types

This section is empty.

Jump to

Keyboard shortcuts

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