Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (*Backend) InvokeScaling ¶
func (b *Backend) InvokeScaling(req *state.ScalingRequest)
InvokeScaling satisfies the InvokeScaling function on the Scale interface.
type BackendConfig ¶
type BackendConfig struct {
Provider *serverCfg.ProviderConfig
Logger zerolog.Logger
Nomad *client.Nomad
NodeResources resource.Handler
ScaleState state.ScaleBackend
PolicyState state.PolicyBackend
}
type Scale ¶
type Scale interface {
// OKToScale performs a number of safety checks to ensure the scaling request does not break
// any policy parameters and that the request has a chance to run successfully. The int
// returned indicates the appropriate HTTP response code, the error will contain any relevant
// messages which describe the check that failed. If no error is returned, it can be assumed
// that the request is OK to continue with.
OKToScale(req *state.ScalingRequest) (int, error)
// InvokeScaling triggers a scaling activity, all events from this point will be written to the
// state store. The function is designed to be called asynchronously, therefore there is no
// return.
InvokeScaling(req *state.ScalingRequest)
}
Scale is the interface used to perform scaling checks and trigger activities.
func NewScaleBackend ¶
func NewScaleBackend(cfg *BackendConfig) Scale
Click to show internal directories.
Click to hide internal directories.