Documentation ¶
Overview ¶
Package radinit is a generated GoMock package.
Copyright 2023 The Radius Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner)
- func NewProgessModel(options initOptions) tea.Model
- func NewSummaryModel(options initOptions) tea.Model
- type DevRecipe
- type DevRecipeClient
- type MockDevRecipeClient
- type MockDevRecipeClientGetDevRecipesCall
- func (c *MockDevRecipeClientGetDevRecipesCall) Do(...) *MockDevRecipeClientGetDevRecipesCall
- func (c *MockDevRecipeClientGetDevRecipesCall) DoAndReturn(...) *MockDevRecipeClientGetDevRecipesCall
- func (c *MockDevRecipeClientGetDevRecipesCall) Return(arg0 map[string]map[string]v20231001preview.RecipePropertiesClassification, ...) *MockDevRecipeClientGetDevRecipesCall
- type MockDevRecipeClientMockRecorder
- type Runner
- func (r *Runner) CreateEnvironment(ctx context.Context) error
- func (r *Runner) Run(ctx context.Context) error
- func (r *Runner) UpdateApplicationOptions(scaffold bool, name string)
- func (r *Runner) UpdateCloudProviderOptions(azure *azure.Provider, aws *cli_aws.Provider)
- func (r *Runner) UpdateClusterOptions(install bool, ns, ctx, version string)
- func (r *Runner) UpdateEnvironmentOptions(create bool, name, ns string)
- func (r *Runner) UpdateRecipePackOptions(devRecipes bool)
- func (r *Runner) Validate(cmd *cobra.Command, args []string) error
Constants ¶
const (
// RecipeRepositoryPrefix is the prefix for the repository path.
RecipeRepositoryPrefix = "ghcr.io/radius-project/recipes/local-dev/"
)
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
This function "NewCommand" creates a new Cobra command with flags and a runner, which can be used to initialize the Radius control-plane.
func NewProgessModel ¶
NewProgessModel creates a new model for the initialization progress dialog shown during 'rad init'.
func NewSummaryModel ¶
NewSummaryModel creates a new model for the options summary shown during 'rad init'.
Types ¶
type DevRecipe ¶ added in v0.27.0
type DevRecipe struct { // NormalizedName is the normalized name of the recipe. // // For example, "mongodatabases". NormalizedName string // ResourceType is the resource type of the recipe. // // For example, "Applications.Datastores/mongoDatabases". ResourceType string // RepoPath is the repository path of the recipe. // // For example, "ghcr.io/radius-project/recipes/local-dev/mongodatabases". RepoPath string }
func AvailableDevRecipes ¶ added in v0.27.0
func AvailableDevRecipes() []DevRecipe
AvailableDevRecipes returns the list of available dev recipes.
If we want to add a new recipe, we need to add it here.
type DevRecipeClient ¶
type DevRecipeClient interface {
GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.RecipePropertiesClassification, error)
}
func NewDevRecipeClient ¶
func NewDevRecipeClient() DevRecipeClient
NewDevRecipeClient creates a new DevRecipeClient object and returns it.
type MockDevRecipeClient ¶
type MockDevRecipeClient struct {
// contains filtered or unexported fields
}
MockDevRecipeClient is a mock of DevRecipeClient interface.
func NewMockDevRecipeClient ¶
func NewMockDevRecipeClient(ctrl *gomock.Controller) *MockDevRecipeClient
NewMockDevRecipeClient creates a new mock instance.
func (*MockDevRecipeClient) EXPECT ¶
func (m *MockDevRecipeClient) EXPECT() *MockDevRecipeClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDevRecipeClient) GetDevRecipes ¶
func (m *MockDevRecipeClient) GetDevRecipes(arg0 context.Context) (map[string]map[string]v20231001preview.RecipePropertiesClassification, error)
GetDevRecipes mocks base method.
type MockDevRecipeClientGetDevRecipesCall ¶ added in v0.35.0
MockDevRecipeClientGetDevRecipesCall wrap *gomock.Call
func (*MockDevRecipeClientGetDevRecipesCall) Do ¶ added in v0.35.0
func (c *MockDevRecipeClientGetDevRecipesCall) Do(f func(context.Context) (map[string]map[string]v20231001preview.RecipePropertiesClassification, error)) *MockDevRecipeClientGetDevRecipesCall
Do rewrite *gomock.Call.Do
func (*MockDevRecipeClientGetDevRecipesCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDevRecipeClientGetDevRecipesCall) DoAndReturn(f func(context.Context) (map[string]map[string]v20231001preview.RecipePropertiesClassification, error)) *MockDevRecipeClientGetDevRecipesCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDevRecipeClientGetDevRecipesCall) Return ¶ added in v0.35.0
func (c *MockDevRecipeClientGetDevRecipesCall) Return(arg0 map[string]map[string]v20231001preview.RecipePropertiesClassification, arg1 error) *MockDevRecipeClientGetDevRecipesCall
Return rewrite *gomock.Call.Return
type MockDevRecipeClientMockRecorder ¶
type MockDevRecipeClientMockRecorder struct {
// contains filtered or unexported fields
}
MockDevRecipeClientMockRecorder is the mock recorder for MockDevRecipeClient.
func (*MockDevRecipeClientMockRecorder) GetDevRecipes ¶
func (mr *MockDevRecipeClientMockRecorder) GetDevRecipes(arg0 any) *MockDevRecipeClientGetDevRecipesCall
GetDevRecipes indicates an expected call of GetDevRecipes.
type Runner ¶
type Runner struct { // ConfigFileInterface is the interface for the config file. ConfigFileInterface framework.ConfigFileInterface // ConfigHolder is the interface for the config holder. ConfigHolder *framework.ConfigHolder // ConnectionFactory is the interface for the connection factory. ConnectionFactory connections.Factory // HelmInterface is the interface for the helm client. HelmInterface helm.Interface // KubernetesInterface is the interface for the kubernetes client. KubernetesInterface kubernetes.Interface // Output is the interface for console output. Output output.Interface // Prompter is the interface for the prompter. Prompter prompt.Interface // DevRecipeClient is the interface for the dev recipe client. DevRecipeClient DevRecipeClient // Format is the output format. Format string // Workspace is the workspace to use. This will be populated by Validate. Workspace *workspaces.Workspace // Full determines whether or not we ask the user for all options. Full bool // Options provides the options to used for Radius initialization. This will be populated by Validate. Options *initOptions // contains filtered or unexported fields }
Runner is the runner implementation for the `rad init` command.
func NewRunner ¶
NewRunner creates a new Runner struct with the given factory's ConfigHolder, Output, ConnectionFactory, Prompter, ConfigFileInterface, KubernetesInterface, HelmInterface, DevRecipeClient, AWSClient, and AzureClient.
func (*Runner) CreateEnvironment ¶ added in v0.27.0
func (*Runner) Run ¶
Run creates a progress channel, installs the radius control plane, creates an environment, configures cloud providers, scaffolds an application, and updates the config file, all while displaying progress updates to the UI.
func (*Runner) UpdateApplicationOptions ¶ added in v0.27.0
UpdateApplicationOptions updates the application options with the provided values.
func (*Runner) UpdateCloudProviderOptions ¶ added in v0.27.0
UpdateCloudProviderOptions updates the cloud provider options with the provided values.
func (*Runner) UpdateClusterOptions ¶ added in v0.27.0
UpdateClusterOptions updates the cluster options with the provided values.
func (*Runner) UpdateEnvironmentOptions ¶ added in v0.27.0
UpdateEnvironmentOptions updates the environment options with the provided values.
func (*Runner) UpdateRecipePackOptions ¶ added in v0.27.0
UpdateRecipePackOptions updates the recipe pack options with the provided values.
func (*Runner) Validate ¶
Validate gathers input from the user, creates a workspace and options, and confirms the options with the user before returning the options and workspace. If the user does not confirm the options, the function will loop and gather input again. If an error occurs, the function will return an error.