Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actuator ¶
type Actuator interface {
// Execute the plan.
Execute(ctx context.Context, p Plan, executionID string) (int, error)
}
Actuator will execute the given plan.
type Plan ¶
type Plan interface {
// Name is the name of the plan.
Name() string
// Create will perform the plan and will return a list of operations/procedures
// that need to be run to accomplish the plan
Create(ctx context.Context) ([]Procedure, error)
// Finalise will set final status fields when the Plan is complete
Finalise(state models.MicroVMState)
}
Plan represents an interface for a plan of operations.
type Procedure ¶
type Procedure interface {
// Name is the name of the procedure/operation.
Name() string
// Do will perform the operation/procedure.
Do(ctx context.Context) ([]Procedure, error)
// ShouldDo determines if this procedure should be executed
ShouldDo(ctx context.Context) (bool, error)
// Verify the state after Do. Most cases it can return nil
// without doing anything, but in special cases we want to measure
// resources if they are in the desired state.
// Example: When we start MicroVM, it may does not tell us if it was
// successful or not, in Verify we can verify if it's running or not
// and report back an error if the state is not the desired state.
Verify(ctx context.Context) error
}
Procedure represents a procedure/operation that will be carried out as part of executing a plan. All procedures must be idempotent, so they need to measure and then act.
Click to show internal directories.
Click to hide internal directories.