strategy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MPL-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	Impl Strategy
}

Plugin is the plugin.Plugin

func (Plugin) Client

func (Plugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*Plugin) Server

func (p *Plugin) Server(*plugin.MuxBroker) (interface{}, error)

type RPC

type RPC struct {
	// contains filtered or unexported fields
}

func (*RPC) PluginInfo

func (r *RPC) PluginInfo() (*base.PluginInfo, error)

func (*RPC) Run

func (*RPC) SetConfig

func (r *RPC) SetConfig(config map[string]string) error

type RPCServer

type RPCServer struct {
	Impl Strategy
}

func (*RPCServer) PluginInfo

func (s *RPCServer) PluginInfo(_ interface{}, r *base.PluginInfo) error

func (*RPCServer) Run

func (s *RPCServer) Run(req RunRPCReq, resp *sdk.ScalingCheckEvaluation) error

func (*RPCServer) SetConfig

func (s *RPCServer) SetConfig(config map[string]string, resp *error) error

type RunRPCReq added in v0.2.0

type RunRPCReq struct {
	Eval  *sdk.ScalingCheckEvaluation
	Count int64
}

RunRPCReq is an internal request object used by the Run function that ties together the two input variables as a single object as needed when calling the RPCServer.

type Strategy

type Strategy interface {

	// 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)

	PluginInfo() (*base.PluginInfo, error)
	SetConfig(config map[string]string) error
}

Jump to

Keyboard shortcuts

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