Documentation ¶
Index ¶
- type MockRecipeFetcher
- func (f *MockRecipeFetcher) FetchRecipe(ctx context.Context, manifest *types.DiscoveryManifest, friendlyName string) (*types.Recipe, error)
- func (f *MockRecipeFetcher) FetchRecipes(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
- func (f *MockRecipeFetcher) FetchRecommendations(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
- type MockRecipeFileFetcher
- type NerdGraphClient
- type RecipeFetcher
- type RecipeFile
- type RecipeFileFetcher
- type RecipeFileFetcherImpl
- type RecipeInstallTarget
- type RecipePostInstall
- type RecipePreInstall
- type ServiceRecipeFetcher
- func (f *ServiceRecipeFetcher) FetchRecipe(ctx context.Context, manifest *types.DiscoveryManifest, friendlyName string) (*types.Recipe, error)
- func (f *ServiceRecipeFetcher) FetchRecipes(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
- func (f *ServiceRecipeFetcher) FetchRecommendations(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
- type VariableConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockRecipeFetcher ¶
type MockRecipeFetcher struct { FetchRecipeErr error FetchRecipesErr error FetchRecommendationsErr error FetchRecipeCallCount int FetchRecipesCallCount int FetchRecommendationsCallCount int FetchRecipeVals []types.Recipe FetchRecipeVal *types.Recipe FetchRecipesVal []types.Recipe FetchRecommendationsVal []types.Recipe FetchRecipeNameCount map[string]int }
func NewMockRecipeFetcher ¶
func NewMockRecipeFetcher() *MockRecipeFetcher
func (*MockRecipeFetcher) FetchRecipe ¶
func (f *MockRecipeFetcher) FetchRecipe(ctx context.Context, manifest *types.DiscoveryManifest, friendlyName string) (*types.Recipe, error)
func (*MockRecipeFetcher) FetchRecipes ¶
func (f *MockRecipeFetcher) FetchRecipes(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
func (*MockRecipeFetcher) FetchRecommendations ¶
func (f *MockRecipeFetcher) FetchRecommendations(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
type MockRecipeFileFetcher ¶
type MockRecipeFileFetcher struct { FetchRecipeFileFunc func(*url.URL) (*RecipeFile, error) LoadRecipeFileFunc func(string) (*RecipeFile, error) }
func NewMockRecipeFileFetcher ¶
func NewMockRecipeFileFetcher() *MockRecipeFileFetcher
func (*MockRecipeFileFetcher) FetchRecipeFile ¶
func (f *MockRecipeFileFetcher) FetchRecipeFile(url *url.URL) (*RecipeFile, error)
func (*MockRecipeFileFetcher) LoadRecipeFile ¶
func (f *MockRecipeFileFetcher) LoadRecipeFile(filename string) (*RecipeFile, error)
type NerdGraphClient ¶
type RecipeFetcher ¶
type RecipeFetcher interface { FetchRecipe(context.Context, *types.DiscoveryManifest, string) (*types.Recipe, error) FetchRecommendations(context.Context, *types.DiscoveryManifest) ([]types.Recipe, error) FetchRecipes(context.Context, *types.DiscoveryManifest) ([]types.Recipe, error) }
RecipeFetcher is responsible for retrieving recipe information.
func NewServiceRecipeFetcher ¶
func NewServiceRecipeFetcher(client NerdGraphClient) RecipeFetcher
NewServiceRecipeFetcher returns a new instance of ServiceRecipeFetcher.
type RecipeFile ¶
type RecipeFile struct { Description string `yaml:"description"` InputVars []VariableConfig `yaml:"inputVars"` Install map[string]interface{} `yaml:"install"` InstallTargets []RecipeInstallTarget `yaml:"installTargets"` Keywords []string `yaml:"keywords"` LogMatch []types.LogMatch `yaml:"logMatch"` Name string `yaml:"name"` DisplayName string `yaml:"displayName"` PreInstall RecipePreInstall `yaml:"preInstall"` PostInstall RecipePostInstall `yaml:"postInstall"` ProcessMatch []string `yaml:"processMatch"` Repository string `yaml:"repository"` ValidationNRQL string `yaml:"validationNrql"` }
RecipeFile represents a recipe file as defined in the Open Installation Library.
func NewRecipeFile ¶
func NewRecipeFile(recipeFileString string) (*RecipeFile, error)
func RecipeToRecipeFile ¶
func RecipeToRecipeFile(r types.Recipe) (*RecipeFile, error)
func StringToRecipeFile ¶
func StringToRecipeFile(content string) (*RecipeFile, error)
func (*RecipeFile) String ¶
func (f *RecipeFile) String() (string, error)
type RecipeFileFetcher ¶
type RecipeFileFetcher interface { FetchRecipeFile(recipeURL *url.URL) (*RecipeFile, error) LoadRecipeFile(filename string) (*RecipeFile, error) }
func NewRecipeFileFetcher ¶
func NewRecipeFileFetcher() RecipeFileFetcher
type RecipeFileFetcherImpl ¶
type RecipeFileFetcherImpl struct { HTTPGetFunc func(string) (*http.Response, error) // contains filtered or unexported fields }
func (*RecipeFileFetcherImpl) FetchRecipeFile ¶
func (f *RecipeFileFetcherImpl) FetchRecipeFile(recipeURL *url.URL) (*RecipeFile, error)
func (*RecipeFileFetcherImpl) LoadRecipeFile ¶
func (f *RecipeFileFetcherImpl) LoadRecipeFile(filename string) (*RecipeFile, error)
type RecipeInstallTarget ¶
type RecipePostInstall ¶ added in v0.18.25
type RecipePreInstall ¶ added in v0.18.25
type ServiceRecipeFetcher ¶
type ServiceRecipeFetcher struct {
// contains filtered or unexported fields
}
ServiceRecipeFetcher is an implementation of the recipeFetcher interface that relies on the Neerdgraph-stitched recipe service to source its results.
func (*ServiceRecipeFetcher) FetchRecipe ¶
func (f *ServiceRecipeFetcher) FetchRecipe(ctx context.Context, manifest *types.DiscoveryManifest, friendlyName string) (*types.Recipe, error)
FetchRecipe gets a recipe by name from the recipe service.
func (*ServiceRecipeFetcher) FetchRecipes ¶
func (f *ServiceRecipeFetcher) FetchRecipes(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
FetchRecipes fetches all available recipes from the recipe service.
func (*ServiceRecipeFetcher) FetchRecommendations ¶
func (f *ServiceRecipeFetcher) FetchRecommendations(ctx context.Context, manifest *types.DiscoveryManifest) ([]types.Recipe, error)
FetchRecommendations fetches recipe recommendations from the recipe service based on the information passed in the provided DiscoveryManifest.