Documentation ¶
Overview ¶
Package framework is a generated GoMock package.
Package framework is a generated GoMock package.
Index ¶
- func ConfigFromContext(ctx context.Context) *viper.Viper
- func NewContextKey(purpose string) contextKey
- func RunCommand(runner Runner) func(cmd *cobra.Command, args []string) error
- type ConfigFileInterface
- type ConfigFileInterfaceImpl
- func (i *ConfigFileInterfaceImpl) ConfigFromContext(ctx context.Context) *viper.Viper
- func (i *ConfigFileInterfaceImpl) DeleteWorkspace(ctx context.Context, config *viper.Viper, name string) error
- func (i *ConfigFileInterfaceImpl) EditWorkspaces(ctx context.Context, config *viper.Viper, workspace *workspaces.Workspace) error
- func (i *ConfigFileInterfaceImpl) SetDefaultWorkspace(ctx context.Context, config *viper.Viper, name string) error
- type ConfigHolder
- type Factory
- type Impl
- func (i *Impl) GetAWSClient() aws.Client
- func (i *Impl) GetAzureClient() azure.Client
- func (i *Impl) GetBicep() bicep.Interface
- func (i *Impl) GetConfigFileInterface() ConfigFileInterface
- func (i *Impl) GetConfigHolder() *ConfigHolder
- func (i *Impl) GetConnectionFactory() connections.Factory
- func (i *Impl) GetDeploy() deploy.Interface
- func (i *Impl) GetHelmInterface() helm.Interface
- func (i *Impl) GetKubernetesInterface() kubernetes.Interface
- func (i *Impl) GetLogstream() logstream.Interface
- func (i *Impl) GetNamespaceInterface() namespace.Interface
- func (i *Impl) GetOutput() output.Interface
- func (i *Impl) GetPortforward() portforward.Interface
- func (i *Impl) GetPrompter() prompt.Interface
- type MockConfigFileInterface
- func (m *MockConfigFileInterface) ConfigFromContext(arg0 context.Context) *viper.Viper
- func (m *MockConfigFileInterface) DeleteWorkspace(arg0 context.Context, arg1 *viper.Viper, arg2 string) error
- func (m *MockConfigFileInterface) EXPECT() *MockConfigFileInterfaceMockRecorder
- func (m *MockConfigFileInterface) EditWorkspaces(arg0 context.Context, arg1 *viper.Viper, arg2 *workspaces.Workspace) error
- func (m *MockConfigFileInterface) SetDefaultWorkspace(arg0 context.Context, arg1 *viper.Viper, arg2 string) error
- type MockConfigFileInterfaceConfigFromContextCall
- func (c *MockConfigFileInterfaceConfigFromContextCall) Do(f func(context.Context) *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall
- func (c *MockConfigFileInterfaceConfigFromContextCall) DoAndReturn(f func(context.Context) *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall
- func (c *MockConfigFileInterfaceConfigFromContextCall) Return(arg0 *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall
- type MockConfigFileInterfaceDeleteWorkspaceCall
- func (c *MockConfigFileInterfaceDeleteWorkspaceCall) Do(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceDeleteWorkspaceCall
- func (c *MockConfigFileInterfaceDeleteWorkspaceCall) DoAndReturn(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceDeleteWorkspaceCall
- func (c *MockConfigFileInterfaceDeleteWorkspaceCall) Return(arg0 error) *MockConfigFileInterfaceDeleteWorkspaceCall
- type MockConfigFileInterfaceEditWorkspacesCall
- func (c *MockConfigFileInterfaceEditWorkspacesCall) Do(f func(context.Context, *viper.Viper, *workspaces.Workspace) error) *MockConfigFileInterfaceEditWorkspacesCall
- func (c *MockConfigFileInterfaceEditWorkspacesCall) DoAndReturn(f func(context.Context, *viper.Viper, *workspaces.Workspace) error) *MockConfigFileInterfaceEditWorkspacesCall
- func (c *MockConfigFileInterfaceEditWorkspacesCall) Return(arg0 error) *MockConfigFileInterfaceEditWorkspacesCall
- type MockConfigFileInterfaceMockRecorder
- func (mr *MockConfigFileInterfaceMockRecorder) ConfigFromContext(arg0 any) *MockConfigFileInterfaceConfigFromContextCall
- func (mr *MockConfigFileInterfaceMockRecorder) DeleteWorkspace(arg0, arg1, arg2 any) *MockConfigFileInterfaceDeleteWorkspaceCall
- func (mr *MockConfigFileInterfaceMockRecorder) EditWorkspaces(arg0, arg1, arg2 any) *MockConfigFileInterfaceEditWorkspacesCall
- func (mr *MockConfigFileInterfaceMockRecorder) SetDefaultWorkspace(arg0, arg1, arg2 any) *MockConfigFileInterfaceSetDefaultWorkspaceCall
- type MockConfigFileInterfaceSetDefaultWorkspaceCall
- func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) Do(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceSetDefaultWorkspaceCall
- func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) DoAndReturn(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceSetDefaultWorkspaceCall
- func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) Return(arg0 error) *MockConfigFileInterfaceSetDefaultWorkspaceCall
- type MockRunner
- type MockRunnerMockRecorder
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFromContext ¶
The ConfigFromContext function retrieves a viper.Viper configuration from a context.Context, and returns nil if the configuration is not found.
func NewContextKey ¶
func NewContextKey(purpose string) contextKey
NewContextKey creates a new context key based on the given purpose string.
Types ¶
type ConfigFileInterface ¶
type ConfigFileInterface interface { ConfigFromContext(ctx context.Context) *viper.Viper SetDefaultWorkspace(ctx context.Context, config *viper.Viper, name string) error DeleteWorkspace(ctx context.Context, config *viper.Viper, name string) error EditWorkspaces(ctx context.Context, config *viper.Viper, workspace *workspaces.Workspace) error }
type ConfigFileInterfaceImpl ¶
type ConfigFileInterfaceImpl struct { }
func (*ConfigFileInterfaceImpl) ConfigFromContext ¶
func (i *ConfigFileInterfaceImpl) ConfigFromContext(ctx context.Context) *viper.Viper
ConfigFromContext takes in a context object and returns a viper object, or an error if the context object is invalid.
func (*ConfigFileInterfaceImpl) DeleteWorkspace ¶
func (i *ConfigFileInterfaceImpl) DeleteWorkspace(ctx context.Context, config *viper.Viper, name string) error
DeleteWorkspace deletes a workspace from the configuration file and sets the default workspace to an empty string if the deleted workspace was the default workspace. It returns an error if the workspace could not be deleted.
func (*ConfigFileInterfaceImpl) EditWorkspaces ¶
func (i *ConfigFileInterfaceImpl) EditWorkspaces(ctx context.Context, config *viper.Viper, workspace *workspaces.Workspace) error
EditWorkspaces adds a workspace to a configuration file, ensuring that the workspace name is lowercase and that there are no duplicate workspace names.
func (*ConfigFileInterfaceImpl) SetDefaultWorkspace ¶
func (i *ConfigFileInterfaceImpl) SetDefaultWorkspace(ctx context.Context, config *viper.Viper, name string) error
SetDefaultWorkspace edits the configuration file to set the default workspace to the given name, and returns an error if the operation fails.
type ConfigHolder ¶
type ConfigHolder struct { ConfigFilePath string Config *viper.Viper DirectoryConfig *config.DirectoryConfig }
type Factory ¶
type Factory interface { GetBicep() bicep.Interface GetConnectionFactory() connections.Factory GetConfigHolder() *ConfigHolder GetDeploy() deploy.Interface GetLogstream() logstream.Interface GetOutput() output.Interface // GetPortforward fetches the portforward interface. GetPortforward() portforward.Interface GetPrompter() prompt.Interface GetConfigFileInterface() ConfigFileInterface GetKubernetesInterface() kubernetes.Interface GetHelmInterface() helm.Interface GetNamespaceInterface() namespace.Interface // GetAWSClient returns the AWS Client. GetAWSClient() aws.Client // GetAzureClient returns the Azure Client. GetAzureClient() azure.Client }
Factory interface handles resources for interfacing with corerp and configs
type Impl ¶
type Impl struct { Bicep bicep.Interface ConnectionFactory connections.Factory ConfigHolder *ConfigHolder Deploy deploy.Interface Logstream logstream.Interface Output output.Interface Portforward portforward.Interface Prompter prompt.Interface ConfigFileInterface ConfigFileInterface KubernetesInterface kubernetes.Interface HelmInterface helm.Interface NamespaceInterface namespace.Interface // AWSClient is the client for AWS. AWSClient aws.Client // AzureClient is the client for Azure. AzureClient azure.Client }
func (*Impl) GetAWSClient ¶
GetAWSClient returns the AWSClient stored in the Impl struct.
func (*Impl) GetAzureClient ¶
GetAzureClient returns an azure.Client from the Impl struct.
func (*Impl) GetConfigFileInterface ¶
func (i *Impl) GetConfigFileInterface() ConfigFileInterface
GetConfigFileInterface returns the ConfigFileInterface stored in the Impl struct.
func (*Impl) GetConfigHolder ¶
func (i *Impl) GetConfigHolder() *ConfigHolder
GetConfigHolder() returns a pointer to the ConfigHolder struct stored in the Impl struct.
func (*Impl) GetConnectionFactory ¶
func (i *Impl) GetConnectionFactory() connections.Factory
GetConnectionFactory returns the ConnectionFactory stored in the Impl struct.
func (*Impl) GetHelmInterface ¶
GetHelmInterface returns the helm.Interface stored in the Impl struct.
func (*Impl) GetKubernetesInterface ¶
func (i *Impl) GetKubernetesInterface() kubernetes.Interface
GetKubernetesInterface returns the KubernetesInterface stored in the Impl struct.
func (*Impl) GetLogstream ¶
GetLogstream returns the logstream.Interface stored in the Impl struct.
func (*Impl) GetNamespaceInterface ¶
GetNamespaceInterface returns the namespace interface stored in the Impl struct.
func (*Impl) GetPortforward ¶
func (i *Impl) GetPortforward() portforward.Interface
GetPortforward() returns the portforward.Interface stored in the Impl struct.
func (*Impl) GetPrompter ¶
GetPrompter() returns the Prompter field of the Impl struct, which is of type prompt.Interface.
type MockConfigFileInterface ¶
type MockConfigFileInterface struct {
// contains filtered or unexported fields
}
MockConfigFileInterface is a mock of ConfigFileInterface interface.
func NewMockConfigFileInterface ¶
func NewMockConfigFileInterface(ctrl *gomock.Controller) *MockConfigFileInterface
NewMockConfigFileInterface creates a new mock instance.
func (*MockConfigFileInterface) ConfigFromContext ¶
func (m *MockConfigFileInterface) ConfigFromContext(arg0 context.Context) *viper.Viper
ConfigFromContext mocks base method.
func (*MockConfigFileInterface) DeleteWorkspace ¶
func (m *MockConfigFileInterface) DeleteWorkspace(arg0 context.Context, arg1 *viper.Viper, arg2 string) error
DeleteWorkspace mocks base method.
func (*MockConfigFileInterface) EXPECT ¶
func (m *MockConfigFileInterface) EXPECT() *MockConfigFileInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConfigFileInterface) EditWorkspaces ¶
func (m *MockConfigFileInterface) EditWorkspaces(arg0 context.Context, arg1 *viper.Viper, arg2 *workspaces.Workspace) error
EditWorkspaces mocks base method.
func (*MockConfigFileInterface) SetDefaultWorkspace ¶
func (m *MockConfigFileInterface) SetDefaultWorkspace(arg0 context.Context, arg1 *viper.Viper, arg2 string) error
SetDefaultWorkspace mocks base method.
type MockConfigFileInterfaceConfigFromContextCall ¶ added in v0.35.0
MockConfigFileInterfaceConfigFromContextCall wrap *gomock.Call
func (*MockConfigFileInterfaceConfigFromContextCall) Do ¶ added in v0.35.0
func (c *MockConfigFileInterfaceConfigFromContextCall) Do(f func(context.Context) *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall
Do rewrite *gomock.Call.Do
func (*MockConfigFileInterfaceConfigFromContextCall) DoAndReturn ¶ added in v0.35.0
func (c *MockConfigFileInterfaceConfigFromContextCall) DoAndReturn(f func(context.Context) *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockConfigFileInterfaceConfigFromContextCall) Return ¶ added in v0.35.0
func (c *MockConfigFileInterfaceConfigFromContextCall) Return(arg0 *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall
Return rewrite *gomock.Call.Return
type MockConfigFileInterfaceDeleteWorkspaceCall ¶ added in v0.35.0
MockConfigFileInterfaceDeleteWorkspaceCall wrap *gomock.Call
func (*MockConfigFileInterfaceDeleteWorkspaceCall) Do ¶ added in v0.35.0
func (c *MockConfigFileInterfaceDeleteWorkspaceCall) Do(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceDeleteWorkspaceCall
Do rewrite *gomock.Call.Do
func (*MockConfigFileInterfaceDeleteWorkspaceCall) DoAndReturn ¶ added in v0.35.0
func (c *MockConfigFileInterfaceDeleteWorkspaceCall) DoAndReturn(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceDeleteWorkspaceCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockConfigFileInterfaceDeleteWorkspaceCall) Return ¶ added in v0.35.0
func (c *MockConfigFileInterfaceDeleteWorkspaceCall) Return(arg0 error) *MockConfigFileInterfaceDeleteWorkspaceCall
Return rewrite *gomock.Call.Return
type MockConfigFileInterfaceEditWorkspacesCall ¶ added in v0.35.0
MockConfigFileInterfaceEditWorkspacesCall wrap *gomock.Call
func (*MockConfigFileInterfaceEditWorkspacesCall) Do ¶ added in v0.35.0
func (c *MockConfigFileInterfaceEditWorkspacesCall) Do(f func(context.Context, *viper.Viper, *workspaces.Workspace) error) *MockConfigFileInterfaceEditWorkspacesCall
Do rewrite *gomock.Call.Do
func (*MockConfigFileInterfaceEditWorkspacesCall) DoAndReturn ¶ added in v0.35.0
func (c *MockConfigFileInterfaceEditWorkspacesCall) DoAndReturn(f func(context.Context, *viper.Viper, *workspaces.Workspace) error) *MockConfigFileInterfaceEditWorkspacesCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockConfigFileInterfaceEditWorkspacesCall) Return ¶ added in v0.35.0
func (c *MockConfigFileInterfaceEditWorkspacesCall) Return(arg0 error) *MockConfigFileInterfaceEditWorkspacesCall
Return rewrite *gomock.Call.Return
type MockConfigFileInterfaceMockRecorder ¶
type MockConfigFileInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockConfigFileInterfaceMockRecorder is the mock recorder for MockConfigFileInterface.
func (*MockConfigFileInterfaceMockRecorder) ConfigFromContext ¶
func (mr *MockConfigFileInterfaceMockRecorder) ConfigFromContext(arg0 any) *MockConfigFileInterfaceConfigFromContextCall
ConfigFromContext indicates an expected call of ConfigFromContext.
func (*MockConfigFileInterfaceMockRecorder) DeleteWorkspace ¶
func (mr *MockConfigFileInterfaceMockRecorder) DeleteWorkspace(arg0, arg1, arg2 any) *MockConfigFileInterfaceDeleteWorkspaceCall
DeleteWorkspace indicates an expected call of DeleteWorkspace.
func (*MockConfigFileInterfaceMockRecorder) EditWorkspaces ¶
func (mr *MockConfigFileInterfaceMockRecorder) EditWorkspaces(arg0, arg1, arg2 any) *MockConfigFileInterfaceEditWorkspacesCall
EditWorkspaces indicates an expected call of EditWorkspaces.
func (*MockConfigFileInterfaceMockRecorder) SetDefaultWorkspace ¶
func (mr *MockConfigFileInterfaceMockRecorder) SetDefaultWorkspace(arg0, arg1, arg2 any) *MockConfigFileInterfaceSetDefaultWorkspaceCall
SetDefaultWorkspace indicates an expected call of SetDefaultWorkspace.
type MockConfigFileInterfaceSetDefaultWorkspaceCall ¶ added in v0.35.0
MockConfigFileInterfaceSetDefaultWorkspaceCall wrap *gomock.Call
func (*MockConfigFileInterfaceSetDefaultWorkspaceCall) Do ¶ added in v0.35.0
func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) Do(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceSetDefaultWorkspaceCall
Do rewrite *gomock.Call.Do
func (*MockConfigFileInterfaceSetDefaultWorkspaceCall) DoAndReturn ¶ added in v0.35.0
func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) DoAndReturn(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceSetDefaultWorkspaceCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockConfigFileInterfaceSetDefaultWorkspaceCall) Return ¶ added in v0.35.0
func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) Return(arg0 error) *MockConfigFileInterfaceSetDefaultWorkspaceCall
Return rewrite *gomock.Call.Return
type MockRunner ¶
type MockRunner struct {
// contains filtered or unexported fields
}
MockRunner is a mock of Runner interface.
func NewMockRunner ¶
func NewMockRunner(ctrl *gomock.Controller) *MockRunner
NewMockRunner creates a new mock instance.
func (*MockRunner) EXPECT ¶
func (m *MockRunner) EXPECT() *MockRunnerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockRunnerMockRecorder ¶
type MockRunnerMockRecorder struct {
// contains filtered or unexported fields
}
MockRunnerMockRecorder is the mock recorder for MockRunner.
func (*MockRunnerMockRecorder) Run ¶
func (mr *MockRunnerMockRecorder) Run(arg0 interface{}) *gomock.Call
Run indicates an expected call of Run.
func (*MockRunnerMockRecorder) Validate ¶
func (mr *MockRunnerMockRecorder) Validate(arg0, arg1 interface{}) *gomock.Call
Validate indicates an expected call of Validate.