Documentation
¶
Overview ¶
Package estimation defines a pluggable migration estimation calculator.
Each part of the calculation is encapsulated in one specific Calculator, and calculation results are aggregated by the Engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
type Calculator interface {
// Name returns the human-readable name of this calculator, used as the key in Engine results.
Name() string
// Keys returns the list of Param keys this calculator depends on.
Keys() []string
// Calculate runs the estimation using the provided params and returns an Estimation or an error.
Calculate(params map[string]Param) (Estimation, error)
}
Calculator encapsulates one specific part of the estimation (e.g. "post migration troubleshooting", "storage migration").
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine orchestrates Calculator objects and aggregates their results
func NewEngine ¶
func NewEngine() *Engine
NewEngine creates a new Engine with no calculators registered.
func (*Engine) Register ¶
func (e *Engine) Register(c Calculator)
Register adds a Calculator to participate in the estimation. Calculators are executed in the order they are registered. Register panics if a calculator with the same Name() is already registered, as duplicate names would silently overwrite results in Run.
type Estimation ¶
Estimation the result of a Calculator calculation
Directories
¶
| Path | Synopsis |
|---|---|
|
Package calculators provides concrete Calculator implementations for the estimation engine.
|
Package calculators provides concrete Calculator implementations for the estimation engine. |