execution

package
v0.18.13 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatusTypes = struct {
	AVAILABLE  StatusType
	INSTALLING StatusType
	FAILED     StatusType
	INSTALLED  StatusType
	SKIPPED    StatusType
}{
	AVAILABLE:  "AVAILABLE",
	INSTALLING: "INSTALLING",
	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

func (*GoTaskRecipeExecutor) Prepare

type MockFailingRecipeExecutor added in v0.18.11

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

func NewMockFailingRecipeExecutor added in v0.18.11

func NewMockFailingRecipeExecutor() *MockFailingRecipeExecutor

func (*MockFailingRecipeExecutor) Execute added in v0.18.11

func (*MockFailingRecipeExecutor) Prepare added in v0.18.11

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

func (*MockRecipeExecutor) Prepare

type MockStatusReporter

type MockStatusReporter struct {
	ReportRecipeAvailableErr        error
	ReportRecipesAvailableErr       error
	ReportRecipeFailedErr           error
	ReportRecipeInstalledErr        error
	ReportRecipeInstallingErr       error
	ReportRecipeSkippedErr          error
	ReportCompleteErr               error
	ReportRecipeAvailableCallCount  int
	ReportRecipesAvailableCallCount int
	ReportRecipeFailedCallCount     int
	ReportRecipeInstalledCallCount  int
	ReportRecipeInstallingCallCount 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(status *StatusRollup) error

func (*MockStatusReporter) ReportRecipeAvailable added in v0.8.12

func (r *MockStatusReporter) ReportRecipeAvailable(status *StatusRollup, recipe types.Recipe) error

func (*MockStatusReporter) ReportRecipeFailed

func (r *MockStatusReporter) ReportRecipeFailed(status *StatusRollup, event RecipeStatusEvent) error

func (*MockStatusReporter) ReportRecipeInstalled

func (r *MockStatusReporter) ReportRecipeInstalled(status *StatusRollup, event RecipeStatusEvent) error

func (*MockStatusReporter) ReportRecipeInstalling added in v0.18.11

func (r *MockStatusReporter) ReportRecipeInstalling(status *StatusRollup, event RecipeStatusEvent) error

func (*MockStatusReporter) ReportRecipeSkipped

func (r *MockStatusReporter) ReportRecipeSkipped(status *StatusRollup, event RecipeStatusEvent) error

func (*MockStatusReporter) ReportRecipesAvailable

func (r *MockStatusReporter) ReportRecipesAvailable(status *StatusRollup, 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(status *StatusRollup) error

func (NerdstorageStatusReporter) ReportRecipeAvailable added in v0.8.12

func (r NerdstorageStatusReporter) ReportRecipeAvailable(status *StatusRollup, recipe types.Recipe) error

ReportRecipeAvailable reports that a recipe is available for installation on the underlying host.

func (NerdstorageStatusReporter) ReportRecipeFailed

func (r NerdstorageStatusReporter) ReportRecipeFailed(status *StatusRollup, event RecipeStatusEvent) error

func (NerdstorageStatusReporter) ReportRecipeInstalled

func (r NerdstorageStatusReporter) ReportRecipeInstalled(status *StatusRollup, event RecipeStatusEvent) error

func (NerdstorageStatusReporter) ReportRecipeInstalling added in v0.18.11

func (r NerdstorageStatusReporter) ReportRecipeInstalling(status *StatusRollup, event RecipeStatusEvent) error

func (NerdstorageStatusReporter) ReportRecipeSkipped

func (r NerdstorageStatusReporter) ReportRecipeSkipped(status *StatusRollup, event RecipeStatusEvent) error

func (NerdstorageStatusReporter) ReportRecipesAvailable

func (r NerdstorageStatusReporter) ReportRecipesAvailable(status *StatusRollup, recipes []types.Recipe) error

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

type RecipeExecutor

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 {
	ReportComplete(status *StatusRollup) error
	ReportRecipeAvailable(status *StatusRollup, recipe types.Recipe) error
	ReportRecipeFailed(status *StatusRollup, event RecipeStatusEvent) error
	ReportRecipeInstalled(status *StatusRollup, event RecipeStatusEvent) error
	ReportRecipeInstalling(status *StatusRollup, event RecipeStatusEvent) error
	ReportRecipeSkipped(status *StatusRollup, event RecipeStatusEvent) error
	ReportRecipesAvailable(status *StatusRollup, recipes []types.Recipe) 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"`
	LogFilePath string   `json:"logFilePath"`
	// contains filtered or unexported fields
}

func NewStatusRollup

func NewStatusRollup(reporters []StatusReporter) *StatusRollup

func (*StatusRollup) ReportComplete added in v0.18.11

func (s *StatusRollup) ReportComplete()

func (*StatusRollup) ReportRecipeAvailable added in v0.18.11

func (s *StatusRollup) ReportRecipeAvailable(recipe types.Recipe)

func (*StatusRollup) ReportRecipeFailed added in v0.18.11

func (s *StatusRollup) ReportRecipeFailed(event RecipeStatusEvent)

func (*StatusRollup) ReportRecipeInstalled added in v0.18.11

func (s *StatusRollup) ReportRecipeInstalled(event RecipeStatusEvent)

func (*StatusRollup) ReportRecipeInstalling added in v0.18.11

func (s *StatusRollup) ReportRecipeInstalling(event RecipeStatusEvent)

func (*StatusRollup) ReportRecipeSkipped added in v0.18.11

func (s *StatusRollup) ReportRecipeSkipped(event RecipeStatusEvent)

func (*StatusRollup) ReportRecipesAvailable added in v0.18.11

func (s *StatusRollup) ReportRecipesAvailable(recipes []types.Recipe)

type StatusType

type StatusType string

type TerminalStatusReporter added in v0.18.11

type TerminalStatusReporter struct {
}

func NewTerminalStatusReporter added in v0.18.11

func NewTerminalStatusReporter() *TerminalStatusReporter

NewTerminalStatusReporter is an implementation of the ExecutionStatusReporter interface that reports execution status to STDOUT.

func (TerminalStatusReporter) ReportComplete added in v0.18.11

func (r TerminalStatusReporter) ReportComplete(status *StatusRollup) error

func (TerminalStatusReporter) ReportRecipeAvailable added in v0.18.11

func (r TerminalStatusReporter) ReportRecipeAvailable(status *StatusRollup, recipe types.Recipe) error

func (TerminalStatusReporter) ReportRecipeFailed added in v0.18.11

func (r TerminalStatusReporter) ReportRecipeFailed(status *StatusRollup, event RecipeStatusEvent) error

func (TerminalStatusReporter) ReportRecipeInstalled added in v0.18.11

func (r TerminalStatusReporter) ReportRecipeInstalled(status *StatusRollup, event RecipeStatusEvent) error

func (TerminalStatusReporter) ReportRecipeInstalling added in v0.18.11

func (r TerminalStatusReporter) ReportRecipeInstalling(status *StatusRollup, event RecipeStatusEvent) error

func (TerminalStatusReporter) ReportRecipeSkipped added in v0.18.11

func (r TerminalStatusReporter) ReportRecipeSkipped(status *StatusRollup, event RecipeStatusEvent) error

func (TerminalStatusReporter) ReportRecipesAvailable added in v0.18.11

func (r TerminalStatusReporter) ReportRecipesAvailable(status *StatusRollup, recipes []types.Recipe) error

Jump to

Keyboard shortcuts

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