recipes

package
v0.18.10 Latest Latest
Warning

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

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

Documentation

Index

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
}

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) ([]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 NerdGraphClient interface {
	QueryWithResponseAndContext(context.Context, string, map[string]interface{}, interface{}) error
}

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.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"`
	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)

func (*RecipeFile) ToRecipe

func (f *RecipeFile) ToRecipe() (*types.Recipe, 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 RecipeInstallTarget struct {
	Type            string `yaml:"type"`
	OS              string `yaml:"os"`
	Platform        string `yaml:"platform"`
	PlatformFamily  string `yaml:"platformFamily"`
	PlatformVersion string `yaml:"platformVersion"`
	KernelVersion   string `yaml:"kernelVersion"`
	KernelArch      string `yaml:"kernelArch"`
}

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) ([]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.

type VariableConfig

type VariableConfig struct {
	Name    string `yaml:"name"`
	Prompt  string `yaml:"prompt"`
	Secret  bool   `secret:"prompt"`
	Default string `yaml:"default"`
}

Jump to

Keyboard shortcuts

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