Documentation ¶
Index ¶
- Variables
- type GoTaskRecipeExecutor
- type MockNerdStorageClient
- type MockRecipeExecutor
- type MockStatusReporter
- func (r *MockStatusReporter) ReportComplete() error
- func (r *MockStatusReporter) ReportRecipeFailed(event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipeInstalled(event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipeSkipped(event RecipeStatusEvent) error
- func (r *MockStatusReporter) ReportRecipesAvailable(recipes []types.Recipe) error
- type NerdStorageClient
- type NerdstorageStatusReporter
- func (r NerdstorageStatusReporter) ReportComplete() error
- func (r NerdstorageStatusReporter) ReportRecipeFailed(e RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipeInstalled(e RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipeSkipped(e RecipeStatusEvent) error
- func (r NerdstorageStatusReporter) ReportRecipesAvailable(recipes []types.Recipe) error
- type RecipeExecutor
- type RecipeStatusEvent
- type Status
- type StatusRecipeError
- type StatusReporter
- type StatusRollup
- type StatusType
Constants ¶
This section is empty.
Variables ¶
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 ¶
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) (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) (types.RecipeVars, error)
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 { Prepare(context.Context, types.DiscoveryManifest, types.Recipe) (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 { 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