-
Notifications
You must be signed in to change notification settings - Fork 69
/
interfaces.go
50 lines (39 loc) · 1.62 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package install
import (
"context"
"net/url"
"github.com/newrelic/newrelic-cli/internal/install/types"
)
type ConfigValidator interface {
Validate(ctx context.Context) error
}
// Discoverer is responsible for discovering informataion about the host system.
type Discoverer interface {
Discover(context.Context) (*types.DiscoveryManifest, error)
}
// FileFilterer determines the existence of files on the underlying filesystem.
type FileFilterer interface {
Filter(context.Context, []types.OpenInstallationRecipe) ([]types.OpenInstallationLogMatch, error)
}
type Prompter interface {
PromptYesNo(msg string) (bool, error)
MultiSelect(msg string, options []string) ([]string, error)
}
type RecipeFileFetcher interface {
FetchRecipeFile(recipeURL *url.URL) (*types.OpenInstallationRecipe, error)
LoadRecipeFile(filename string) (*types.OpenInstallationRecipe, error)
}
type RecipeFilterRunner interface {
RunFilterAll(ctx context.Context, r []types.OpenInstallationRecipe, m *types.DiscoveryManifest) []types.OpenInstallationRecipe
EnsureDoesNotFilter(ctx context.Context, r []types.OpenInstallationRecipe, m *types.DiscoveryManifest) error
}
// RecipeValidator validates installation of a recipe.
type RecipeValidator interface {
ValidateRecipe(context.Context, types.DiscoveryManifest, types.OpenInstallationRecipe, types.RecipeVars) (entityGUID string, err error)
}
type RecipeVarPreparer interface {
Prepare(m types.DiscoveryManifest, r types.OpenInstallationRecipe, assumeYes bool, licenseKey string) (types.RecipeVars, error)
}
type RecipeRepository interface {
FindAll(m types.DiscoveryManifest) []types.OpenInstallationRecipe
}