strategy

package
v0.4.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginStrategy added in v0.3.0

type PluginStrategy struct {

	// Embedded so we disable support for net/rpc based plugins.
	plugin.NetRPCUnsupportedPlugin

	// Impl is the Strategy interface implementation that the plugin serves.
	Impl Strategy
}

PluginStrategy is the Strategy implementation of the go-plugin GRPCPlugin interface.

func (*PluginStrategy) GRPCClient added in v0.3.0

func (p *PluginStrategy) GRPCClient(ctx context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient is the Strategy implementation of the go-plugin GRPCPlugin.GRPCClient interface function.

func (*PluginStrategy) GRPCServer added in v0.3.0

func (p *PluginStrategy) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer is the Strategy implementation of the go-plugin GRPCPlugin.GRPCServer interface function.

type Strategy

type Strategy interface {

	// Embed base.Base ensuring that strategy plugins implement this interface.
	base.Base

	// Run triggers a run of the strategy calculation. It is responsible for
	// populating the sdk.ScalingAction object within the passed eval and
	// returning the eval to the caller. The count input variable represents
	// the current state of the scaling target.
	Run(eval *sdk.ScalingCheckEvaluation, count int64) (*sdk.ScalingCheckEvaluation, error)
}

Strategy is the interface that all Strategy plugins are required to implement. The Strategy plugin is responsible to performing calculations that produce a desired state based on a number of input parameters.

Directories

Path Synopsis
proto
v1

Jump to

Keyboard shortcuts

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