execution

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatusTypes = struct {
	AVAILABLE StatusType
	FAILED    StatusType
	INSTALLED StatusType
	SKIPPED   StatusType
}{
	AVAILABLE: "AVAILABLE",
	FAILED:    "FAILED",
	INSTALLED: "INSTALLED",
	SKIPPED:   "SKIPPED",
}

Functions

This section is empty.

Types

type GoTaskRecipeExecutor

type GoTaskRecipeExecutor struct{}

GoTaskRecipeExecutor is an implementation of the recipeExecutor interface that uses the go-task module to execute the steps defined in each recipe.

func NewGoTaskRecipeExecutor

func NewGoTaskRecipeExecutor() *GoTaskRecipeExecutor

NewGoTaskRecipeExecutor returns a new instance of GoTaskRecipeExecutor.

func (*GoTaskRecipeExecutor) Execute

type MockNerdStorageClient

type MockNerdStorageClient struct {
	WriteDocumentWithUserScopeVal   interface{}
	WriteDocumentWithEntityScopeVal interface{}
	WriteDocumentWithUserScopeErr   error
	WriteDocumentWithEntityScopeErr error
	// contains filtered or unexported fields
}

func NewMockNerdStorageClient

func NewMockNerdStorageClient() *MockNerdStorageClient

func (*MockNerdStorageClient) WriteDocumentWithEntityScope

func (c *MockNerdStorageClient) WriteDocumentWithEntityScope(string, nerdstorage.WriteDocumentInput) (interface{}, error)

func (*MockNerdStorageClient) WriteDocumentWithUserScope

func (c *MockNerdStorageClient) WriteDocumentWithUserScope(nerdstorage.WriteDocumentInput) (interface{}, error)

type MockRecipeExecutor

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

func NewMockRecipeExecutor

func NewMockRecipeExecutor() *MockRecipeExecutor

func (*MockRecipeExecutor) Execute

type MockStatusReporter

type MockStatusReporter struct {
	ReportRecipesAvailableErr       error
	ReportRecipeFailedErr           error
	ReportRecipeInstalledErr        error
	ReportRecipeSkippedErr          error
	ReportCompleteErr               error
	ReportRecipesAvailableCallCount int
	ReportRecipeFailedCallCount     int
	ReportRecipeInstalledCallCount  int
	ReportRecipeSkippedCallCount    int
	ReportCompleteCallCount         int
}

MockStatusReporter is a mock implementation of the ExecutionStatusReporter interface that provides method spies for testing scenarios.

func NewMockStatusReporter

func NewMockStatusReporter() *MockStatusReporter

NewMockStatusReporter returns a new instance of MockExecutionStatusReporter.

func (*MockStatusReporter) ReportComplete

func (r *MockStatusReporter) ReportComplete() error

func (*MockStatusReporter) ReportRecipeFailed

func (r *MockStatusReporter) ReportRecipeFailed(event RecipeStatusEvent) error

func (*MockStatusReporter) ReportRecipeInstalled

func (r *MockStatusReporter) ReportRecipeInstalled(event RecipeStatusEvent) error

func (*MockStatusReporter) ReportRecipeSkipped

func (r *MockStatusReporter) ReportRecipeSkipped(event RecipeStatusEvent) error

func (*MockStatusReporter) ReportRecipesAvailable

func (r *MockStatusReporter) ReportRecipesAvailable(recipes []types.Recipe) error

type NerdStorageClient

type NerdStorageClient interface {
	WriteDocumentWithUserScope(nerdstorage.WriteDocumentInput) (interface{}, error)
	WriteDocumentWithEntityScope(string, nerdstorage.WriteDocumentInput) (interface{}, error)
}

type NerdstorageStatusReporter

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

NerdstorageStatusReporter is an implementation of the ExecutionStatusReporter interface that reports esecution status into NerdStorage.

func NewNerdStorageStatusReporter

func NewNerdStorageStatusReporter(client NerdStorageClient) *NerdstorageStatusReporter

NewNerdStorageStatusReporter returns a new instance of NerdStorageExecutionStatusReporter.

func (NerdstorageStatusReporter) ReportComplete

func (r NerdstorageStatusReporter) ReportComplete() error

func (NerdstorageStatusReporter) ReportRecipeFailed

func (r NerdstorageStatusReporter) ReportRecipeFailed(e RecipeStatusEvent) error

func (NerdstorageStatusReporter) ReportRecipeInstalled

func (r NerdstorageStatusReporter) ReportRecipeInstalled(e RecipeStatusEvent) error

func (NerdstorageStatusReporter) ReportRecipeSkipped

func (r NerdstorageStatusReporter) ReportRecipeSkipped(e RecipeStatusEvent) error

func (NerdstorageStatusReporter) ReportRecipesAvailable

func (r NerdstorageStatusReporter) ReportRecipesAvailable(recipes []types.Recipe) error

ReportRecipesAvailable reports that recipes are available for installation on the underlying host.

type RecipeExecutor

type RecipeExecutor interface {
	Execute(context.Context, types.DiscoveryManifest, types.Recipe) error
}

RecipeExecutor is responsible for execution of the task steps defined in a recipe.

type RecipeStatusEvent

type RecipeStatusEvent struct {
	Recipe     types.Recipe
	Msg        string
	EntityGUID string
}

RecipeStatusEvent represents an event in a recipe's execution.

type Status

type Status struct {
	Name        string              `json:"name"`
	DisplayName string              `json:"displayName"`
	Status      StatusType          `json:"status"`
	Errors      []StatusRecipeError `json:"errors"`
}

type StatusRecipeError

type StatusRecipeError struct {
	Message string `json:"message"`
	Details string `json:"details"`
}

type StatusReporter

type StatusReporter interface {
	ReportRecipeFailed(event RecipeStatusEvent) error
	ReportRecipeInstalled(event RecipeStatusEvent) error
	ReportRecipeSkipped(event RecipeStatusEvent) error
	ReportRecipesAvailable(recipes []types.Recipe) error
	ReportComplete() error
}

StatusReporter is responsible for reporting the status of recipe execution.

type StatusRollup

type StatusRollup struct {
	Complete    bool `json:"complete"`
	DocumentID  string
	EntityGUIDs []string `json:"entityGuids"`
	Statuses    []Status `json:"recipes"`
	Timestamp   int64    `json:"timestamp"`
}

func NewStatusRollup

func NewStatusRollup() StatusRollup

type StatusType

type StatusType string

Jump to

Keyboard shortcuts

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