wasm

package
v0.0.0-...-ce05823 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToNodeScoreList

func MapToNodeScoreList(scoreMap map[string]int) []framework.NodeScore

Transforms a map of node names and scores (as integers) into a slice of framework.NodeScore structures.

func NewFromConfig

func NewFromConfig(ctx context.Context, pluginName string, config PluginConfig, frameworkHandle framework.Handle) (framework.Plugin, error)

NewFromConfig is like New, except it allows us to explicitly provide the context and configuration of the plugin. This allows flexibility in tests.

func NodeScoreListToMap

func NodeScoreListToMap(nodeScoreList []framework.NodeScore) map[string]int

Converts a list of framework.NodeScore to a map with node names as keys and their scores as integer values.

func PluginFactory

func PluginFactory(pluginName string) frameworkruntime.PluginFactory

Types

type EventMessage

type EventMessage struct {
	RegardingReference ObjectReference
	RelatedReference   ObjectReference
	Eventtype          string
	Reason             string
	Action             string
	Note               string
}

type ObjectReference

type ObjectReference struct {
	Kind            string
	APIVersion      string
	Name            string
	Namespace       string
	UID             string
	ResourceVersion string
}

type PluginConfig

type PluginConfig struct {
	// GuestURL is the URL to the guest wasm.
	// Valid schemes are file:// for a local file or http[s]:// for one
	// retrieved via HTTP.
	GuestURL string `json:"guestURL"`

	// GuestConfig is any configuration to give to the guest.
	GuestConfig string `json:"guestConfig"`

	// LogSeverity has the following values:
	//
	//   - 0: info (default)
	//   - 1: warning
	//   - 2: error
	//   - 3: fatal
	LogSeverity int32 `json:"logSeverity"`

	// Args are the os.Args the guest will receive, exposed for tests.
	Args []string
}

type ProfilerSupport

type ProfilerSupport interface {
	Guest() wazero.CompiledModule
	// contains filtered or unexported methods
}

ProfilerSupport exposes functions needed to profile the guest with wzprof.

Jump to

Keyboard shortcuts

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