engine

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 12 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, opts GetRecipeMetadataOptions) (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 GetRecipeMetadataOptions added in v0.35.0

type GetRecipeMetadataOptions struct {
	BaseOptions
	RecipeDefinition recipes.EnvironmentDefinition
}

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 GetRecipeMetadataOptions) (map[string]any, error)

GetRecipeMetadata mocks base method.

type MockEngineDeleteCall added in v0.35.0

type MockEngineDeleteCall struct {
	*gomock.Call
}

MockEngineDeleteCall wrap *gomock.Call

func (*MockEngineDeleteCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockEngineDeleteCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockEngineDeleteCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockEngineExecuteCall added in v0.35.0

type MockEngineExecuteCall struct {
	*gomock.Call
}

MockEngineExecuteCall wrap *gomock.Call

func (*MockEngineExecuteCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockEngineExecuteCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockEngineExecuteCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockEngineGetRecipeMetadataCall added in v0.35.0

type MockEngineGetRecipeMetadataCall struct {
	*gomock.Call
}

MockEngineGetRecipeMetadataCall wrap *gomock.Call

func (*MockEngineGetRecipeMetadataCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockEngineGetRecipeMetadataCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockEngineGetRecipeMetadataCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

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 any) *MockEngineDeleteCall

Delete indicates an expected call of Delete.

func (*MockEngineMockRecorder) Execute

func (mr *MockEngineMockRecorder) Execute(arg0, arg1 any) *MockEngineExecuteCall

Execute indicates an expected call of Execute.

func (*MockEngineMockRecorder) GetRecipeMetadata

func (mr *MockEngineMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockEngineGetRecipeMetadataCall

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