Documentation
¶
Index ¶
- Variables
- type GoTaskRecipeExecutor
- type MockFailingRecipeExecutor
- type MockNerdStorageClient
- type MockRecipeExecutor
- type MockStatusReporter
- func (r *MockStatusReporter) ReportComplete(status *StatusRollup) error
- func (r *MockStatusReporter) ReportRecipeAvailable(status *StatusRollup, recipe types.Recipe) error
- func (r *MockStatusReporter) ReportRecipeFailed(status *StatusRollup, event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipeInstalled(status *StatusRollup, event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipeInstalling(status *StatusRollup, event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipeRecommended(status *StatusRollup, event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipeSkipped(status *StatusRollup, event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipesAvailable(status *StatusRollup, recipes []types.Recipe) error
- type NerdStorageClient
- type NerdstorageStatusReporter
- func (r NerdstorageStatusReporter) ReportComplete(status *StatusRollup) error
- func (r NerdstorageStatusReporter) ReportRecipeAvailable(status *StatusRollup, recipe types.Recipe) error
- func (r NerdstorageStatusReporter) ReportRecipeFailed(status *StatusRollup, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipeInstalled(status *StatusRollup, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipeInstalling(status *StatusRollup, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipeRecommended(status *StatusRollup, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipeSkipped(status *StatusRollup, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipesAvailable(status *StatusRollup, recipes []types.Recipe) error
- type RecipeExecutor
- type RecipeStatusEvent
- type Status
- type StatusRecipeError
- type StatusReporter
- type StatusRollup
- func (s *StatusRollup) ReportComplete()
- func (s *StatusRollup) ReportRecipeAvailable(recipe types.Recipe)
- func (s *StatusRollup) ReportRecipeFailed(event RecipeStatusEvent)
- func (s *StatusRollup) ReportRecipeInstalled(event RecipeStatusEvent)
- func (s *StatusRollup) ReportRecipeInstalling(event RecipeStatusEvent)
- func (s *StatusRollup) ReportRecipeRecommended(event RecipeStatusEvent)
- func (s *StatusRollup) ReportRecipeSkipped(event RecipeStatusEvent)
- func (s *StatusRollup) ReportRecipesAvailable(recipes []types.Recipe)
- type StatusType
- type TerminalStatusReporter
- func (r TerminalStatusReporter) ReportComplete(status *StatusRollup) error
- func (r TerminalStatusReporter) ReportRecipeAvailable(status *StatusRollup, recipe types.Recipe) error
- func (r TerminalStatusReporter) ReportRecipeFailed(status *StatusRollup, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) ReportRecipeInstalled(status *StatusRollup, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) ReportRecipeInstalling(status *StatusRollup, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) ReportRecipeRecommended(status *StatusRollup, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) ReportRecipeSkipped(status *StatusRollup, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) ReportRecipesAvailable(status *StatusRollup, recipes []types.Recipe) error
Constants ¶
This section is empty.
Variables ¶
var StatusTypes = struct { AVAILABLE StatusType INSTALLING StatusType FAILED StatusType INSTALLED StatusType SKIPPED StatusType RECOMMENDED StatusType }{ AVAILABLE: "AVAILABLE", INSTALLING: "INSTALLING", FAILED: "FAILED", INSTALLED: "INSTALLED", SKIPPED: "SKIPPED", RECOMMENDED: "RECOMMENDED", }
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 (re *GoTaskRecipeExecutor) Execute(ctx context.Context, m types.DiscoveryManifest, r types.Recipe, recipeVars types.RecipeVars) error
func (*GoTaskRecipeExecutor) Prepare ¶
func (re *GoTaskRecipeExecutor) Prepare(ctx context.Context, m types.DiscoveryManifest, r types.Recipe, assumeYes bool) (types.RecipeVars, error)
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 (m *MockFailingRecipeExecutor) Execute(ctx context.Context, dm types.DiscoveryManifest, r types.Recipe, v types.RecipeVars) error
func (*MockFailingRecipeExecutor) Prepare ¶ added in v0.18.11
func (m *MockFailingRecipeExecutor) Prepare(ctx context.Context, dm types.DiscoveryManifest, r types.Recipe, y bool) (types.RecipeVars, error)
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 (m *MockRecipeExecutor) Execute(ctx context.Context, dm types.DiscoveryManifest, r types.Recipe, v types.RecipeVars) error
func (*MockRecipeExecutor) Prepare ¶
func (m *MockRecipeExecutor) Prepare(ctx context.Context, dm types.DiscoveryManifest, r types.Recipe, y bool) (types.RecipeVars, error)
type MockStatusReporter ¶
type MockStatusReporter struct { ReportRecipeAvailableErr error ReportRecipesAvailableErr error ReportRecipeFailedErr error ReportRecipeInstalledErr error ReportRecipeInstallingErr error ReportRecipeRecommendedErr error ReportRecipeSkippedErr error ReportCompleteErr error ReportRecipeAvailableCallCount int ReportRecipesAvailableCallCount int ReportRecipeFailedCallCount int ReportRecipeInstalledCallCount int ReportRecipeInstallingCallCount int ReportRecipeRecommendedCallCount int ReportRecipeSkippedCallCount int ReportCompleteCallCount int ReportSkipped map[string]int ReportInstalled map[string]int ReportInstalling map[string]int ReportRecommended map[string]int ReportFailed map[string]int ReportAvailable map[string]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) ReportRecipeRecommended ¶ added in v0.18.23
func (r *MockStatusReporter) ReportRecipeRecommended(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) ReportRecipeRecommended ¶ added in v0.18.23
func (r NerdstorageStatusReporter) ReportRecipeRecommended(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 ¶
type RecipeExecutor interface { Prepare(context.Context, types.DiscoveryManifest, types.Recipe, bool) (types.RecipeVars, error) Execute(context.Context, types.DiscoveryManifest, types.Recipe, types.RecipeVars) error }
RecipeExecutor is responsible for execution of the task steps defined in a recipe.
type RecipeStatusEvent ¶
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 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 ReportRecipeRecommended(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) ReportRecipeRecommended ¶ added in v0.18.23
func (s *StatusRollup) ReportRecipeRecommended(event RecipeStatusEvent)
ReportRecipeRecommended is responsible for setting the nerstorage scopes when a recipe is recommended. This is used when a recipe is found, but not a "HOST" type, and is used to indicate to the user that it is something they should consider integrating, but not something that the recipe framework will currently assist with.
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) ReportRecipeRecommended ¶ added in v0.18.23
func (r TerminalStatusReporter) ReportRecipeRecommended(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