recipes

package
v0.93.6 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BundleTypes = struct {
	// MacOS operating system
	CORE BundleType
	// Linux-based operating system
	ADDITIONALGUIDED BundleType
	// Windows operating system
	ADDITIONALTARGETED BundleType
}{

	CORE: "CORE",

	ADDITIONALGUIDED: "ADDITIONALGUIDED",

	ADDITIONALTARGETED: "ADDITIONALTARGETED",
}
View Source
var (
	//go:embed files/*
	EmbeddedFS embed.FS
)
View Source
var ErrRecipeNotFound = errors.New("recipe not found")

ErrRecipeNotFound is used when a recipe is requested by name, but does not exist for the given constraint.

Functions

func GetPsUtilCommandLines added in v0.43.0

func GetPsUtilCommandLines(ctx context.Context) []types.GenericProcess

func NewRecipeFile

func NewRecipeFile(recipeFileString string) (*types.OpenInstallationRecipe, error)

Types

type Bundle added in v0.43.0

type Bundle struct {
	BundleRecipes []*BundleRecipe
	Type          BundleType
}

func (*Bundle) AddRecipe added in v0.43.0

func (b *Bundle) AddRecipe(bundleRecipe *BundleRecipe)

func (*Bundle) AvailableRecipeCount added in v0.43.0

func (b *Bundle) AvailableRecipeCount() int

func (*Bundle) ContainsName added in v0.43.0

func (b *Bundle) ContainsName(name string) (int, bool)

func (*Bundle) GetBundleRecipe added in v0.44.0

func (b *Bundle) GetBundleRecipe(name string) *BundleRecipe

func (*Bundle) IsAdditionalGuided added in v0.43.0

func (b *Bundle) IsAdditionalGuided() bool

func (*Bundle) IsAdditionalTargeted added in v0.43.0

func (b *Bundle) IsAdditionalTargeted() bool

func (*Bundle) String added in v0.43.0

func (b *Bundle) String() string

type BundleRecipe added in v0.43.0

type BundleRecipe struct {
	Recipe           *types.OpenInstallationRecipe
	Dependencies     []*BundleRecipe
	DetectedStatuses []*DetectedStatusType
}

func (*BundleRecipe) AddDetectionStatus added in v0.43.0

func (br *BundleRecipe) AddDetectionStatus(newStatus execution.RecipeStatusType, durationMs int64)

func (*BundleRecipe) AreAllDependenciesAvailable added in v0.44.0

func (br *BundleRecipe) AreAllDependenciesAvailable() bool

func (*BundleRecipe) HasStatus added in v0.43.0

func (br *BundleRecipe) HasStatus(status execution.RecipeStatusType) bool

func (*BundleRecipe) IsNameInDependencies added in v0.44.0

func (br *BundleRecipe) IsNameInDependencies(depName string) bool

func (*BundleRecipe) LastStatus added in v0.85.0

func (br *BundleRecipe) LastStatus(status execution.RecipeStatusType) bool

func (*BundleRecipe) String added in v0.43.0

func (br *BundleRecipe) String() string

type BundleType added in v0.43.0

type BundleType string

OpenInstallationOperatingSystem - Operating System of target environment

type Bundler added in v0.43.0

type Bundler struct {
	AvailableRecipes RecipeDetectionResults
	Context          context.Context

	HasSuperInstalled bool
	// contains filtered or unexported fields
}

func NewBundler added in v0.43.0

func NewBundler(context context.Context, availableRecipes RecipeDetectionResults) *Bundler

func (*Bundler) CreateAdditionalGuidedBundle added in v0.43.0

func (b *Bundler) CreateAdditionalGuidedBundle() *Bundle

func (*Bundler) CreateAdditionalTargetedBundle added in v0.43.0

func (b *Bundler) CreateAdditionalTargetedBundle(recipes []string) *Bundle

func (*Bundler) CreateCoreBundle added in v0.43.0

func (b *Bundler) CreateCoreBundle() *Bundle

func (*Bundler) GetCoreRecipeNames added in v0.85.0

func (b *Bundler) GetCoreRecipeNames() []string

func (*Bundler) IsCore added in v0.87.0

func (b *Bundler) IsCore(recipeName string) bool

IsCore checks if a recipe is a core recipe

type DetectedStatusType added in v0.43.0

type DetectedStatusType struct {
	Status     execution.RecipeStatusType
	DurationMs int64
}

func (*DetectedStatusType) String added in v0.43.0

func (ds *DetectedStatusType) String() string

type DetectionStatusProvider added in v0.43.0

type DetectionStatusProvider interface {
	DetectionStatus(context.Context, *types.OpenInstallationRecipe, []string) execution.RecipeStatusType
}

type EmbeddedRecipeFetcher added in v0.31.0

type EmbeddedRecipeFetcher struct{}

func NewEmbeddedRecipeFetcher added in v0.31.0

func NewEmbeddedRecipeFetcher() *EmbeddedRecipeFetcher

func (*EmbeddedRecipeFetcher) FetchLibraryVersion added in v0.32.0

func (f *EmbeddedRecipeFetcher) FetchLibraryVersion(ctx context.Context) string

func (*EmbeddedRecipeFetcher) FetchRecipes added in v0.31.0

func (f *EmbeddedRecipeFetcher) FetchRecipes(context.Context) (out []*types.OpenInstallationRecipe, err error)

type Finder added in v0.49.0

type Finder interface {
	FindAll() ([]*types.OpenInstallationRecipe, error)
}

type LocalRecipeFetcher added in v0.24.0

type LocalRecipeFetcher struct {
	Path string
}

func (*LocalRecipeFetcher) FetchLibraryVersion added in v0.32.0

func (f *LocalRecipeFetcher) FetchLibraryVersion(ctx context.Context) string

func (*LocalRecipeFetcher) FetchRecipes added in v0.24.0

type LogMatchFinder added in v0.43.0

type LogMatchFinder struct{}

func (*LogMatchFinder) GetPaths added in v0.43.0

type LogMatchFinderDefinition added in v0.43.0

type LogMatchFinderDefinition interface {
	GetPaths(context.Context, []*types.OpenInstallationRecipe) []types.OpenInstallationLogMatch
}

func NewLogMatchFinder added in v0.43.0

func NewLogMatchFinder() LogMatchFinderDefinition

func NewMockLogMatchFinder added in v0.43.0

func NewMockLogMatchFinder() LogMatchFinderDefinition

NewMockFileFilterer creates a new instance of MockFileFilterer.

type MockLogMatchFinder added in v0.43.0

type MockLogMatchFinder struct {
	Matches []types.OpenInstallationLogMatch
}

func (*MockLogMatchFinder) GetPaths added in v0.43.0

type MockNerdGraphClient added in v0.29.0

type MockNerdGraphClient struct {
	RespBody interface{}
}

func NewMockNerdGraphClient added in v0.29.0

func NewMockNerdGraphClient() *MockNerdGraphClient

func (*MockNerdGraphClient) QueryWithResponseAndContext added in v0.29.0

func (c *MockNerdGraphClient) QueryWithResponseAndContext(ctx context.Context, query string, variables map[string]interface{}, respBody interface{}) error

type MockProcess added in v0.51.0

type MockProcess struct {
	// contains filtered or unexported fields
}

func NewMockProcess added in v0.51.0

func NewMockProcess(cmd string, name string, pid int32) *MockProcess

func (MockProcess) Cmd added in v0.51.0

func (p MockProcess) Cmd() (string, error)

func (MockProcess) Name added in v0.51.0

func (p MockProcess) Name() (string, error)

func (MockProcess) PID added in v0.51.0

func (p MockProcess) PID() int32

type MockProcessEvaluator added in v0.51.0

type MockProcessEvaluator struct {
	// contains filtered or unexported fields
}

func NewMockProcessEvaluator added in v0.51.0

func NewMockProcessEvaluator() *MockProcessEvaluator

func (*MockProcessEvaluator) DetectionStatus added in v0.51.0

func (*MockProcessEvaluator) FindProcess added in v0.79.0

func (pe *MockProcessEvaluator) FindProcess(process string) bool

func (*MockProcessEvaluator) GetOrLoadProcesses added in v0.51.0

func (pe *MockProcessEvaluator) GetOrLoadProcesses(ctx context.Context) []types.GenericProcess

func (*MockProcessEvaluator) WithProcesses added in v0.51.0

func (pe *MockProcessEvaluator) WithProcesses(processes []types.GenericProcess)

type MockProcessMatchFinder added in v0.43.0

type MockProcessMatchFinder struct {
	// contains filtered or unexported fields
}

func NewMockProcessMatchFinder added in v0.43.0

func NewMockProcessMatchFinder() *MockProcessMatchFinder

func (*MockProcessMatchFinder) FindMatches added in v0.43.0

func (*MockProcessMatchFinder) FindMatchesMultiple added in v0.43.0

func (f *MockProcessMatchFinder) FindMatchesMultiple(ctx context.Context, processes []types.GenericProcess, recipes []types.OpenInstallationRecipe) []types.MatchedProcess

type MockRecipeEvaluator added in v0.43.0

type MockRecipeEvaluator struct {
	// contains filtered or unexported fields
}

func NewMockRecipeEvaluator added in v0.44.0

func NewMockRecipeEvaluator() *MockRecipeEvaluator

func (*MockRecipeEvaluator) DetectionStatus added in v0.43.0

func (mre *MockRecipeEvaluator) DetectionStatus(ctx context.Context, recipe *types.OpenInstallationRecipe, recipeNames []string) execution.RecipeStatusType

func (*MockRecipeEvaluator) WithRecipeStatus added in v0.44.0

func (mre *MockRecipeEvaluator) WithRecipeStatus(recipe *types.OpenInstallationRecipe, status execution.RecipeStatusType)

type MockRecipeFetcher

type MockRecipeFetcher struct {
	FetchRecipesErr       error
	FetchRecipesCallCount int
	FetchRecipesVal       []*types.OpenInstallationRecipe
	LibraryVersion        string
}

func NewMockRecipeFetcher

func NewMockRecipeFetcher() *MockRecipeFetcher

func (*MockRecipeFetcher) FetchLibraryVersion added in v0.32.0

func (f *MockRecipeFetcher) FetchLibraryVersion(ctx context.Context) string

func (*MockRecipeFetcher) FetchRecipes

type MockRecipeFileFetcher

type MockRecipeFileFetcher struct {
	FetchRecipeFileFunc func(*url.URL) (*types.OpenInstallationRecipe, error)
	LoadRecipeFileFunc  func(string) (*types.OpenInstallationRecipe, error)
}

func NewMockRecipeFileFetcher

func NewMockRecipeFileFetcher() *MockRecipeFileFetcher

func (*MockRecipeFileFetcher) FetchRecipeFile

func (f *MockRecipeFileFetcher) FetchRecipeFile(url *url.URL) (*types.OpenInstallationRecipe, error)

func (*MockRecipeFileFetcher) LoadRecipeFile

func (f *MockRecipeFileFetcher) LoadRecipeFile(filename string) (*types.OpenInstallationRecipe, error)

type NerdGraphClient

type NerdGraphClient interface {
	QueryWithResponseAndContext(context.Context, string, map[string]interface{}, interface{}) error
}

type PSUtilProcess added in v0.43.0

type PSUtilProcess struct {
	// contains filtered or unexported fields
}

func NewPSUtilProcess added in v0.43.0

func NewPSUtilProcess(p *process.Process) PSUtilProcess

func (PSUtilProcess) Cmd added in v0.43.0

func (p PSUtilProcess) Cmd() (string, error)

func (PSUtilProcess) Name added in v0.43.0

func (p PSUtilProcess) Name() (string, error)

func (PSUtilProcess) PID added in v0.43.0

func (p PSUtilProcess) PID() int32

type ProcessEvaluator added in v0.43.0

type ProcessEvaluator struct {
	// contains filtered or unexported fields
}

func NewProcessEvaluator added in v0.43.0

func NewProcessEvaluator() *ProcessEvaluator

func (*ProcessEvaluator) DetectionStatus added in v0.43.0

func (pe *ProcessEvaluator) DetectionStatus(ctx context.Context, r *types.OpenInstallationRecipe, recipeNames []string) execution.RecipeStatusType

func (*ProcessEvaluator) FindProcess added in v0.79.0

func (pe *ProcessEvaluator) FindProcess(process string) bool

func (*ProcessEvaluator) GetOrLoadProcesses added in v0.51.0

func (pe *ProcessEvaluator) GetOrLoadProcesses(ctx context.Context) []types.GenericProcess

type ProcessEvaluatorInterface added in v0.51.0

type ProcessEvaluatorInterface interface {
	GetOrLoadProcesses(ctx context.Context) []types.GenericProcess
	DetectionStatus(ctx context.Context, r *types.OpenInstallationRecipe, recipeNames []string) execution.RecipeStatusType
	FindProcess(process string) bool
}

type ProcessMatchFinder added in v0.28.0

type RecipeBuilder added in v0.43.0

type RecipeBuilder struct {
	DiscoveryMode []types.OpenInstallationDiscoveryMode
	// contains filtered or unexported fields
}

func NewRecipeBuilder added in v0.43.0

func NewRecipeBuilder() *RecipeBuilder

func (*RecipeBuilder) Build added in v0.43.0

func (*RecipeBuilder) BuildBundleRecipe added in v0.44.0

func (b *RecipeBuilder) BuildBundleRecipe() *BundleRecipe

func (*RecipeBuilder) Dependency added in v0.44.0

func (b *RecipeBuilder) Dependency(dependency *BundleRecipe) *RecipeBuilder

func (*RecipeBuilder) DependencyName added in v0.44.0

func (b *RecipeBuilder) DependencyName(depName string) *RecipeBuilder

func (*RecipeBuilder) ID added in v0.43.0

func (b *RecipeBuilder) ID(id string) *RecipeBuilder

func (*RecipeBuilder) InstallGoTaskScript added in v0.43.0

func (b *RecipeBuilder) InstallGoTaskScript(script string) *RecipeBuilder

func (*RecipeBuilder) InstallShell added in v0.43.0

func (b *RecipeBuilder) InstallShell(script string) *RecipeBuilder

func (*RecipeBuilder) Name added in v0.43.0

func (b *RecipeBuilder) Name(name string) *RecipeBuilder

func (*RecipeBuilder) ProcessMatch added in v0.43.0

func (b *RecipeBuilder) ProcessMatch(match string) *RecipeBuilder

func (*RecipeBuilder) TargetOs added in v0.43.0

func (*RecipeBuilder) TargetOsArch added in v0.43.0

func (*RecipeBuilder) TargetOsPlatform added in v0.43.0

func (*RecipeBuilder) TargetOsPlatformVersionArch added in v0.43.0

func (b *RecipeBuilder) TargetOsPlatformVersionArch(os types.OpenInstallationOperatingSystem, platformVersion string, arch string) *RecipeBuilder

func (*RecipeBuilder) Vars added in v0.43.0

func (b *RecipeBuilder) Vars(key string, value string) *RecipeBuilder

func (*RecipeBuilder) WithDiscoveryMode added in v0.70.0

func (b *RecipeBuilder) WithDiscoveryMode(discoveryMode []types.OpenInstallationDiscoveryMode) *RecipeBuilder

func (*RecipeBuilder) WithPreInstallScript added in v0.43.0

func (b *RecipeBuilder) WithPreInstallScript(script string) *RecipeBuilder

type RecipeDetectionResult added in v0.49.0

type RecipeDetectionResult struct {
	Recipe     *types.OpenInstallationRecipe
	Status     execution.RecipeStatusType
	DurationMs int64
}

type RecipeDetectionResults added in v0.49.0

type RecipeDetectionResults []*RecipeDetectionResult

func (*RecipeDetectionResults) GetRecipeDetection added in v0.49.0

func (rd *RecipeDetectionResults) GetRecipeDetection(name string) (*RecipeDetectionResult, bool)

func (RecipeDetectionResults) Len added in v0.49.0

func (rd RecipeDetectionResults) Len() int

func (RecipeDetectionResults) Less added in v0.49.0

func (rd RecipeDetectionResults) Less(i, j int) bool

func (RecipeDetectionResults) Swap added in v0.49.0

func (rd RecipeDetectionResults) Swap(i, j int)

type RecipeDetector added in v0.43.0

type RecipeDetector struct {
	// contains filtered or unexported fields
}

func NewRecipeDetector added in v0.43.0

func (*RecipeDetector) GetDetectedRecipes added in v0.49.0

type RecipeFetcher

type RecipeFetcher interface {
	FetchRecipes(context.Context) ([]*types.OpenInstallationRecipe, error)
	FetchLibraryVersion(context.Context) string
}

RecipeFetcher is responsible for retrieving recipe information.

type RecipeFileFetcher

type RecipeFileFetcher struct {
	HTTPGetFunc func(string) (*http.Response, error)

	Paths []string
	// contains filtered or unexported fields
}

func NewRecipeFileFetcher

func NewRecipeFileFetcher(paths []string) *RecipeFileFetcher

func (*RecipeFileFetcher) FetchLibraryVersion added in v0.43.0

func (rff *RecipeFileFetcher) FetchLibraryVersion(ctx context.Context) string

func (*RecipeFileFetcher) FetchRecipeFile

func (rff *RecipeFileFetcher) FetchRecipeFile(recipeURL *url.URL) (*types.OpenInstallationRecipe, error)

func (*RecipeFileFetcher) FetchRecipes added in v0.43.0

func (rff *RecipeFileFetcher) FetchRecipes(ctx context.Context) ([]*types.OpenInstallationRecipe, error)

func (*RecipeFileFetcher) LoadRecipeFile

func (rff *RecipeFileFetcher) LoadRecipeFile(filename string) (*types.OpenInstallationRecipe, error)

type RecipeRepository added in v0.28.0

type RecipeRepository struct {
	RecipeLoaderFunc func() ([]*types.OpenInstallationRecipe, error)
	// contains filtered or unexported fields
}

func NewRecipeRepository added in v0.28.0

func NewRecipeRepository(loaderFunc func() ([]*types.OpenInstallationRecipe, error), manifest *types.DiscoveryManifest) *RecipeRepository

NewRecipeRepository returns a new instance of types.RecipeRepository.

func (*RecipeRepository) FindAll added in v0.28.0

func (rf *RecipeRepository) FindAll() ([]*types.OpenInstallationRecipe, error)

func (*RecipeRepository) FindRecipeByName added in v0.43.0

func (rf *RecipeRepository) FindRecipeByName(name string) *types.OpenInstallationRecipe

func (*RecipeRepository) FindRecipes added in v0.43.0

func (rf *RecipeRepository) FindRecipes(excludingRecipes []*types.OpenInstallationRecipe) []*types.OpenInstallationRecipe

type RegexProcessMatchFinder added in v0.28.0

type RegexProcessMatchFinder struct{}

func NewRegexProcessMatchFinder added in v0.28.0

func NewRegexProcessMatchFinder() *RegexProcessMatchFinder

func (*RegexProcessMatchFinder) FindMatches added in v0.28.0

func (*RegexProcessMatchFinder) FindMatchesMultiple added in v0.28.0

func (f *RegexProcessMatchFinder) FindMatchesMultiple(ctx context.Context, processes []types.GenericProcess, recipes []types.OpenInstallationRecipe) []types.MatchedProcess

type ScriptEvaluator added in v0.43.0

type ScriptEvaluator struct {
	// contains filtered or unexported fields
}

func NewScriptEvaluator added in v0.43.0

func NewScriptEvaluator() *ScriptEvaluator

func (*ScriptEvaluator) DetectionStatus added in v0.43.0

func (se *ScriptEvaluator) DetectionStatus(ctx context.Context, r *types.OpenInstallationRecipe, recipeNames []string) (statusResult execution.RecipeStatusType)

Jump to

Keyboard shortcuts

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