engine

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package engine is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEngine

func NewEngine(options Options) *engine

NewEngine creates a new Engine to deploy recipe.

Types

type BaseOptions

type BaseOptions struct {
	// Recipe is the recipe metadata.
	Recipe recipes.ResourceMetadata
}

BaseOptions is the base options for the engine operations.

type DeleteOptions

type DeleteOptions struct {
	BaseOptions

	// OutputResources is the list of output resources for the recipe.
	OutputResources []rpv1.OutputResource
}

DeleteOptions is the options for the Delete method.

type Engine

type Engine interface {
	// Execute gathers environment configuration, recipe definition and calls the driver to deploy the recipe.
	// prevState is added to the driver execute options, which is used to get the obsolete resources for cleanup. It consists list of recipe output resource IDs that were created in the previous deployment.
	Execute(ctx context.Context, opts ExecuteOptions) (*recipes.RecipeOutput, error)

	// Delete handles deletion of output resources for the recipe deployment.
	Delete(ctx context.Context, opts DeleteOptions) error

	// Gets the Recipe metadata and parameters from Recipe's template path
	GetRecipeMetadata(ctx context.Context, recipeDefinition recipes.EnvironmentDefinition) (map[string]any, error)
}

type ExecuteOptions

type ExecuteOptions struct {
	BaseOptions
	// PreviousState represents previously deployed state of output resource IDs.
	PreviousState []string
	// Simulated is the flag to indicate if the execution is a simulation.
	Simulated bool
}

ExecuteOptions is the options for the Execute method.

type MockEngine

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

MockEngine is a mock of Engine interface.

func NewMockEngine

func NewMockEngine(ctrl *gomock.Controller) *MockEngine

NewMockEngine creates a new mock instance.

func (*MockEngine) Delete

func (m *MockEngine) Delete(arg0 context.Context, arg1 DeleteOptions) error

Delete mocks base method.

func (*MockEngine) EXPECT

func (m *MockEngine) EXPECT() *MockEngineMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEngine) Execute

func (m *MockEngine) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipes.RecipeOutput, error)

Execute mocks base method.

func (*MockEngine) GetRecipeMetadata

func (m *MockEngine) GetRecipeMetadata(arg0 context.Context, arg1 recipes.EnvironmentDefinition) (map[string]interface{}, error)

GetRecipeMetadata mocks base method.

type MockEngineMockRecorder

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

MockEngineMockRecorder is the mock recorder for MockEngine.

func (*MockEngineMockRecorder) Delete

func (mr *MockEngineMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockEngineMockRecorder) Execute

func (mr *MockEngineMockRecorder) Execute(arg0, arg1 interface{}) *gomock.Call

Execute indicates an expected call of Execute.

func (*MockEngineMockRecorder) GetRecipeMetadata

func (mr *MockEngineMockRecorder) GetRecipeMetadata(arg0, arg1 interface{}) *gomock.Call

GetRecipeMetadata indicates an expected call of GetRecipeMetadata.

type Options

type Options struct {
	ConfigurationLoader configloader.ConfigurationLoader
	SecretsLoader       configloader.SecretsLoader
	Drivers             map[string]recipedriver.Driver
}

Options represents the configuration loader and type of driver used to deploy recipe.

Jump to

Keyboard shortcuts

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