Documentation
¶
Index ¶
- Variables
- type ConcreteSuccessLinkGenerator
- type GoTaskRecipeExecutor
- type InstallStatus
- func (s *InstallStatus) DiscoveryComplete(dm types.DiscoveryManifest)
- func (s *InstallStatus) HostEntityGUID() string
- func (s *InstallStatus) InstallCanceled()
- func (s *InstallStatus) InstallComplete()
- func (s *InstallStatus) IsTargetedInstall() bool
- func (s *InstallStatus) RecipeAvailable(recipe types.Recipe)
- func (s *InstallStatus) RecipeFailed(event RecipeStatusEvent)
- func (s *InstallStatus) RecipeInstalled(event RecipeStatusEvent)
- func (s *InstallStatus) RecipeInstalling(event RecipeStatusEvent)
- func (s *InstallStatus) RecipeRecommended(event RecipeStatusEvent)
- func (s *InstallStatus) RecipeSkipped(event RecipeStatusEvent)
- func (s *InstallStatus) RecipesAvailable(recipes []types.Recipe)
- func (s *InstallStatus) RecipesSelected(recipes []types.Recipe)
- func (s *InstallStatus) SetTargetedInstall()
- type MockFailingRecipeExecutor
- type MockNerdStorageClient
- type MockRecipeExecutor
- type MockStatusReporter
- func (r *MockStatusReporter) DiscoveryComplete(status *InstallStatus, dm types.DiscoveryManifest) error
- func (r *MockStatusReporter) InstallCanceled(status *InstallStatus) error
- func (r *MockStatusReporter) InstallComplete(status *InstallStatus) error
- func (r *MockStatusReporter) RecipeAvailable(status *InstallStatus, recipe types.Recipe) error
- func (r *MockStatusReporter) RecipeFailed(status *InstallStatus, event RecipeStatusEvent) error
- func (r *MockStatusReporter) RecipeInstalled(status *InstallStatus, event RecipeStatusEvent) error
- func (r *MockStatusReporter) RecipeInstalling(status *InstallStatus, event RecipeStatusEvent) error
- func (r *MockStatusReporter) RecipeRecommended(status *InstallStatus, event RecipeStatusEvent) error
- func (r *MockStatusReporter) RecipeSkipped(status *InstallStatus, event RecipeStatusEvent) error
- func (r *MockStatusReporter) RecipesAvailable(status *InstallStatus, recipes []types.Recipe) error
- func (r *MockStatusReporter) RecipesSelected(status *InstallStatus, recipes []types.Recipe) error
- type MockSuccessLinkGenerator
- type NerdStorageClient
- type NerdstorageStatusReporter
- func (r NerdstorageStatusReporter) DiscoveryComplete(status *InstallStatus, dm types.DiscoveryManifest) error
- func (r NerdstorageStatusReporter) InstallCanceled(status *InstallStatus) error
- func (r NerdstorageStatusReporter) InstallComplete(status *InstallStatus) error
- func (r NerdstorageStatusReporter) RecipeAvailable(status *InstallStatus, recipe types.Recipe) error
- func (r NerdstorageStatusReporter) RecipeFailed(status *InstallStatus, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) RecipeInstalled(status *InstallStatus, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) RecipeInstalling(status *InstallStatus, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) RecipeRecommended(status *InstallStatus, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) RecipeSkipped(status *InstallStatus, event RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) RecipesAvailable(status *InstallStatus, recipes []types.Recipe) error
- func (r NerdstorageStatusReporter) RecipesSelected(status *InstallStatus, recipes []types.Recipe) error
- type RecipeExecutor
- type RecipeStatus
- type RecipeStatusEvent
- type RecipeStatusType
- type StatusError
- type StatusSubscriber
- type SuccessLinkGenerator
- type TerminalStatusReporter
- func (r TerminalStatusReporter) DiscoveryComplete(status *InstallStatus, dm types.DiscoveryManifest) error
- func (r TerminalStatusReporter) InstallCanceled(status *InstallStatus) error
- func (r TerminalStatusReporter) InstallComplete(status *InstallStatus) error
- func (r TerminalStatusReporter) RecipeAvailable(status *InstallStatus, recipe types.Recipe) error
- func (r TerminalStatusReporter) RecipeFailed(status *InstallStatus, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) RecipeInstalled(status *InstallStatus, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) RecipeInstalling(status *InstallStatus, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) RecipeRecommended(status *InstallStatus, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) RecipeSkipped(status *InstallStatus, event RecipeStatusEvent) error
- func (r TerminalStatusReporter) RecipesAvailable(status *InstallStatus, recipes []types.Recipe) error
- func (r TerminalStatusReporter) RecipesSelected(status *InstallStatus, recipes []types.Recipe) error
Constants ¶
This section is empty.
Variables ¶
var RecipeStatusTypes = struct { AVAILABLE RecipeStatusType CANCELED RecipeStatusType INSTALLING RecipeStatusType FAILED RecipeStatusType INSTALLED RecipeStatusType SKIPPED RecipeStatusType RECOMMENDED RecipeStatusType }{ AVAILABLE: "AVAILABLE", CANCELED: "CANCELED", INSTALLING: "INSTALLING", FAILED: "FAILED", INSTALLED: "INSTALLED", SKIPPED: "SKIPPED", RECOMMENDED: "RECOMMENDED", }
Functions ¶
This section is empty.
Types ¶
type ConcreteSuccessLinkGenerator ¶ added in v0.20.0
type ConcreteSuccessLinkGenerator struct{}
func NewConcreteSuccessLinkGenerator ¶ added in v0.20.0
func NewConcreteSuccessLinkGenerator() *ConcreteSuccessLinkGenerator
func (*ConcreteSuccessLinkGenerator) GenerateEntityLink ¶ added in v0.20.0
func (g *ConcreteSuccessLinkGenerator) GenerateEntityLink(entityGUID string) string
func (*ConcreteSuccessLinkGenerator) GenerateExplorerLink ¶ added in v0.20.0
func (g *ConcreteSuccessLinkGenerator) GenerateExplorerLink(filter string) string
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 InstallStatus ¶ added in v0.18.26
type InstallStatus struct { Complete bool `json:"complete"` DiscoveryManifest types.DiscoveryManifest `json:"discoveryManifest"` EntityGUIDs []string `json:"entityGuids"` Error StatusError `json:"error"` LogFilePath string `json:"logFilePath"` Statuses []*RecipeStatus `json:"recipes"` Timestamp int64 `json:"timestamp"` CLIVersion string `json:"cliVersion"` DocumentID string // contains filtered or unexported fields }
nolint: maligned
func NewInstallStatus ¶ added in v0.18.26
func NewInstallStatus(reporters []StatusSubscriber) *InstallStatus
func (*InstallStatus) DiscoveryComplete ¶ added in v0.19.1
func (s *InstallStatus) DiscoveryComplete(dm types.DiscoveryManifest)
func (*InstallStatus) HostEntityGUID ¶ added in v0.20.0
func (s *InstallStatus) HostEntityGUID() string
func (*InstallStatus) InstallCanceled ¶ added in v0.19.2
func (s *InstallStatus) InstallCanceled()
func (*InstallStatus) InstallComplete ¶ added in v0.18.26
func (s *InstallStatus) InstallComplete()
func (*InstallStatus) IsTargetedInstall ¶ added in v0.20.0
func (s *InstallStatus) IsTargetedInstall() bool
func (*InstallStatus) RecipeAvailable ¶ added in v0.18.26
func (s *InstallStatus) RecipeAvailable(recipe types.Recipe)
func (*InstallStatus) RecipeFailed ¶ added in v0.18.26
func (s *InstallStatus) RecipeFailed(event RecipeStatusEvent)
func (*InstallStatus) RecipeInstalled ¶ added in v0.18.26
func (s *InstallStatus) RecipeInstalled(event RecipeStatusEvent)
func (*InstallStatus) RecipeInstalling ¶ added in v0.18.26
func (s *InstallStatus) RecipeInstalling(event RecipeStatusEvent)
func (*InstallStatus) RecipeRecommended ¶ added in v0.18.26
func (s *InstallStatus) RecipeRecommended(event RecipeStatusEvent)
RecipeRecommended 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 (*InstallStatus) RecipeSkipped ¶ added in v0.18.26
func (s *InstallStatus) RecipeSkipped(event RecipeStatusEvent)
func (*InstallStatus) RecipesAvailable ¶ added in v0.18.26
func (s *InstallStatus) RecipesAvailable(recipes []types.Recipe)
func (*InstallStatus) RecipesSelected ¶ added in v0.18.26
func (s *InstallStatus) RecipesSelected(recipes []types.Recipe)
func (*InstallStatus) SetTargetedInstall ¶ added in v0.20.0
func (s *InstallStatus) SetTargetedInstall()
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 { RecipeAvailableErr error RecipesAvailableErr error RecipesSelectedErr error RecipeFailedErr error RecipeInstalledErr error RecipeInstallingErr error RecipeRecommendedErr error RecipeSkippedErr error InstallCompleteErr error InstallCanceledErr error DiscoveryCompleteErr error RecipeAvailableCallCount int RecipesAvailableCallCount int RecipesSelectedCallCount int RecipeFailedCallCount int RecipeInstalledCallCount int RecipeInstallingCallCount int RecipeRecommendedCallCount int RecipeSkippedCallCount int InstallCompleteCallCount int InstallCanceledCallCount int DiscoveryCompleteCallCount 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 GUIDs []string Durations []int64 RecipeGUID map[string]string }
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) DiscoveryComplete ¶ added in v0.19.1
func (r *MockStatusReporter) DiscoveryComplete(status *InstallStatus, dm types.DiscoveryManifest) error
func (*MockStatusReporter) InstallCanceled ¶ added in v0.19.2
func (r *MockStatusReporter) InstallCanceled(status *InstallStatus) error
func (*MockStatusReporter) InstallComplete ¶ added in v0.18.26
func (r *MockStatusReporter) InstallComplete(status *InstallStatus) error
func (*MockStatusReporter) RecipeAvailable ¶ added in v0.18.26
func (r *MockStatusReporter) RecipeAvailable(status *InstallStatus, recipe types.Recipe) error
func (*MockStatusReporter) RecipeFailed ¶ added in v0.18.26
func (r *MockStatusReporter) RecipeFailed(status *InstallStatus, event RecipeStatusEvent) error
func (*MockStatusReporter) RecipeInstalled ¶ added in v0.18.26
func (r *MockStatusReporter) RecipeInstalled(status *InstallStatus, event RecipeStatusEvent) error
func (*MockStatusReporter) RecipeInstalling ¶ added in v0.18.26
func (r *MockStatusReporter) RecipeInstalling(status *InstallStatus, event RecipeStatusEvent) error
func (*MockStatusReporter) RecipeRecommended ¶ added in v0.18.26
func (r *MockStatusReporter) RecipeRecommended(status *InstallStatus, event RecipeStatusEvent) error
func (*MockStatusReporter) RecipeSkipped ¶ added in v0.18.26
func (r *MockStatusReporter) RecipeSkipped(status *InstallStatus, event RecipeStatusEvent) error
func (*MockStatusReporter) RecipesAvailable ¶ added in v0.18.26
func (r *MockStatusReporter) RecipesAvailable(status *InstallStatus, recipes []types.Recipe) error
func (*MockStatusReporter) RecipesSelected ¶ added in v0.18.26
func (r *MockStatusReporter) RecipesSelected(status *InstallStatus, recipes []types.Recipe) error
type MockSuccessLinkGenerator ¶ added in v0.20.0
type MockSuccessLinkGenerator struct { GenerateExplorerLinkCallCount int GenerateEntityLinkCallCount int GenerateExplorerLinkVal string GenerateEntityLinkVal string }
func NewMockSuccessLinkGenerator ¶ added in v0.20.0
func NewMockSuccessLinkGenerator() *MockSuccessLinkGenerator
func (*MockSuccessLinkGenerator) GenerateEntityLink ¶ added in v0.20.0
func (g *MockSuccessLinkGenerator) GenerateEntityLink(entityGUID string) string
func (*MockSuccessLinkGenerator) GenerateExplorerLink ¶ added in v0.20.0
func (g *MockSuccessLinkGenerator) GenerateExplorerLink(filter string) string
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) DiscoveryComplete ¶ added in v0.19.1
func (r NerdstorageStatusReporter) DiscoveryComplete(status *InstallStatus, dm types.DiscoveryManifest) error
func (NerdstorageStatusReporter) InstallCanceled ¶ added in v0.19.2
func (r NerdstorageStatusReporter) InstallCanceled(status *InstallStatus) error
func (NerdstorageStatusReporter) InstallComplete ¶ added in v0.18.26
func (r NerdstorageStatusReporter) InstallComplete(status *InstallStatus) error
func (NerdstorageStatusReporter) RecipeAvailable ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipeAvailable(status *InstallStatus, recipe types.Recipe) error
RecipeAvailable reports that a recipe is available for installation on the underlying host.
func (NerdstorageStatusReporter) RecipeFailed ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipeFailed(status *InstallStatus, event RecipeStatusEvent) error
func (NerdstorageStatusReporter) RecipeInstalled ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipeInstalled(status *InstallStatus, event RecipeStatusEvent) error
func (NerdstorageStatusReporter) RecipeInstalling ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipeInstalling(status *InstallStatus, event RecipeStatusEvent) error
func (NerdstorageStatusReporter) RecipeRecommended ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipeRecommended(status *InstallStatus, event RecipeStatusEvent) error
func (NerdstorageStatusReporter) RecipeSkipped ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipeSkipped(status *InstallStatus, event RecipeStatusEvent) error
func (NerdstorageStatusReporter) RecipesAvailable ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipesAvailable(status *InstallStatus, recipes []types.Recipe) error
RecipesAvailable reports that recipes are available for installation on the underlying host.
func (NerdstorageStatusReporter) RecipesSelected ¶ added in v0.18.26
func (r NerdstorageStatusReporter) RecipesSelected(status *InstallStatus, recipes []types.Recipe) error
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 RecipeStatus ¶ added in v0.18.26
type RecipeStatus struct { DisplayName string `json:"displayName"` Error StatusError `json:"error"` Name string `json:"name"` Status RecipeStatusType `json:"status"` EntityGUID string `json:"entityGuid,omitempty"` // ValidationDurationMilliseconds is duration in Milliseconds that a recipe took to validate data was flowing. ValidationDurationMilliseconds int64 `json:"validationDurationMilliseconds,omitempty"` }
type RecipeStatusEvent ¶
type RecipeStatusEvent struct { Recipe types.Recipe Msg string EntityGUID string ValidationDurationMilliseconds int64 }
RecipeStatusEvent represents an event in a recipe's execution.
type RecipeStatusType ¶ added in v0.18.26
type RecipeStatusType string
type StatusError ¶ added in v0.19.1
type StatusSubscriber ¶ added in v0.18.26
type StatusSubscriber interface { InstallCanceled(status *InstallStatus) error InstallComplete(status *InstallStatus) error DiscoveryComplete(status *InstallStatus, dm types.DiscoveryManifest) error RecipeAvailable(status *InstallStatus, recipe types.Recipe) error RecipeFailed(status *InstallStatus, event RecipeStatusEvent) error RecipeInstalled(status *InstallStatus, event RecipeStatusEvent) error RecipeInstalling(status *InstallStatus, event RecipeStatusEvent) error RecipeRecommended(status *InstallStatus, event RecipeStatusEvent) error RecipeSkipped(status *InstallStatus, event RecipeStatusEvent) error RecipesAvailable(status *InstallStatus, recipes []types.Recipe) error RecipesSelected(status *InstallStatus, recipes []types.Recipe) error }
StatusSubscriber is notified during the lifecycle of the recipe execution status.
type SuccessLinkGenerator ¶ added in v0.20.0
type TerminalStatusReporter ¶ added in v0.18.11
type TerminalStatusReporter struct {
// contains filtered or unexported fields
}
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) DiscoveryComplete ¶ added in v0.19.1
func (r TerminalStatusReporter) DiscoveryComplete(status *InstallStatus, dm types.DiscoveryManifest) error
func (TerminalStatusReporter) InstallCanceled ¶ added in v0.19.2
func (r TerminalStatusReporter) InstallCanceled(status *InstallStatus) error
func (TerminalStatusReporter) InstallComplete ¶ added in v0.18.26
func (r TerminalStatusReporter) InstallComplete(status *InstallStatus) error
func (TerminalStatusReporter) RecipeAvailable ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipeAvailable(status *InstallStatus, recipe types.Recipe) error
func (TerminalStatusReporter) RecipeFailed ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipeFailed(status *InstallStatus, event RecipeStatusEvent) error
func (TerminalStatusReporter) RecipeInstalled ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipeInstalled(status *InstallStatus, event RecipeStatusEvent) error
func (TerminalStatusReporter) RecipeInstalling ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipeInstalling(status *InstallStatus, event RecipeStatusEvent) error
func (TerminalStatusReporter) RecipeRecommended ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipeRecommended(status *InstallStatus, event RecipeStatusEvent) error
func (TerminalStatusReporter) RecipeSkipped ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipeSkipped(status *InstallStatus, event RecipeStatusEvent) error
func (TerminalStatusReporter) RecipesAvailable ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipesAvailable(status *InstallStatus, recipes []types.Recipe) error
func (TerminalStatusReporter) RecipesSelected ¶ added in v0.18.26
func (r TerminalStatusReporter) RecipesSelected(status *InstallStatus, recipes []types.Recipe) error
Source Files
¶
- go_task_recipe_executor.go
- install_status.go
- mock_failing_recipe_executor.go
- mock_nerdstorage_client.go
- mock_recipe_executor.go
- mock_status_reporter.go
- mock_success_link_generator.go
- nerdstorage_client.go
- nerdstorage_status_reporter.go
- recipe_executor.go
- status_subscriber.go
- success_link_generator.go
- terminal_reporter.go