Documentation ¶
Overview ¶
Package backends is a generated GoMock package.
Index ¶
- Constants
- type Backend
- type MockBackend
- type MockBackendBuildBackendCall
- func (c *MockBackendBuildBackendCall) Do(f func(*recipes.ResourceMetadata) (map[string]any, error)) *MockBackendBuildBackendCall
- func (c *MockBackendBuildBackendCall) DoAndReturn(f func(*recipes.ResourceMetadata) (map[string]any, error)) *MockBackendBuildBackendCall
- func (c *MockBackendBuildBackendCall) Return(arg0 map[string]any, arg1 error) *MockBackendBuildBackendCall
- type MockBackendMockRecorder
- type MockBackendValidateBackendExistsCall
- func (c *MockBackendValidateBackendExistsCall) Do(f func(context.Context, string) (bool, error)) *MockBackendValidateBackendExistsCall
- func (c *MockBackendValidateBackendExistsCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockBackendValidateBackendExistsCall
- func (c *MockBackendValidateBackendExistsCall) Return(arg0 bool, arg1 error) *MockBackendValidateBackendExistsCall
Constants ¶
const ( RadiusNamespace = "radius-system" BackendKubernetes = "kubernetes" // KubernetesBackendNamePrefix is the default prefix added by Terraform to the generated Kubernetes secret name. // Terraform generates the secret name in the format "tfstate-{workspace}-{secret_suffix}". Default terraform workspace // is used for recipes deployment. // https://developer.hashicorp.com/terraform/language/settings/backends/kubernetes // https://developer.hashicorp.com/terraform/language/state/workspaces KubernetesBackendNamePrefix = "tfstate-default-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // BuildBackend generates the Terraform backend configuration for the backend. // Returns a map of Terraform backend name to values representing the backend configuration. // Returns an error if the backend configuration cannot be generated. BuildBackend(resourceRecipe *recipes.ResourceMetadata) (map[string]any, error) // ValidateBackendExists checks if the Terraform state file backend source exists. // For example, for Kubernetes backend, it checks if the Kubernetes secret for Terraform state file exists. // returns true if backend is found, false otherwise. ValidateBackendExists(ctx context.Context, name string) (bool, error) }
Backend is an interface for generating Terraform backend configurations.
func NewKubernetesBackend ¶
func NewKubernetesBackend(k8sClientSet kubernetes.Interface) Backend
type MockBackend ¶
type MockBackend struct {
// contains filtered or unexported fields
}
MockBackend is a mock of Backend interface.
func NewMockBackend ¶
func NewMockBackend(ctrl *gomock.Controller) *MockBackend
NewMockBackend creates a new mock instance.
func (*MockBackend) BuildBackend ¶
func (m *MockBackend) BuildBackend(arg0 *recipes.ResourceMetadata) (map[string]any, error)
BuildBackend mocks base method.
func (*MockBackend) EXPECT ¶
func (m *MockBackend) EXPECT() *MockBackendMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBackend) ValidateBackendExists ¶ added in v0.26.0
ValidateBackendExists mocks base method.
type MockBackendBuildBackendCall ¶ added in v0.35.0
MockBackendBuildBackendCall wrap *gomock.Call
func (*MockBackendBuildBackendCall) Do ¶ added in v0.35.0
func (c *MockBackendBuildBackendCall) Do(f func(*recipes.ResourceMetadata) (map[string]any, error)) *MockBackendBuildBackendCall
Do rewrite *gomock.Call.Do
func (*MockBackendBuildBackendCall) DoAndReturn ¶ added in v0.35.0
func (c *MockBackendBuildBackendCall) DoAndReturn(f func(*recipes.ResourceMetadata) (map[string]any, error)) *MockBackendBuildBackendCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockBackendBuildBackendCall) Return ¶ added in v0.35.0
func (c *MockBackendBuildBackendCall) Return(arg0 map[string]any, arg1 error) *MockBackendBuildBackendCall
Return rewrite *gomock.Call.Return
type MockBackendMockRecorder ¶
type MockBackendMockRecorder struct {
// contains filtered or unexported fields
}
MockBackendMockRecorder is the mock recorder for MockBackend.
func (*MockBackendMockRecorder) BuildBackend ¶
func (mr *MockBackendMockRecorder) BuildBackend(arg0 any) *MockBackendBuildBackendCall
BuildBackend indicates an expected call of BuildBackend.
func (*MockBackendMockRecorder) ValidateBackendExists ¶ added in v0.26.0
func (mr *MockBackendMockRecorder) ValidateBackendExists(arg0, arg1 any) *MockBackendValidateBackendExistsCall
ValidateBackendExists indicates an expected call of ValidateBackendExists.
type MockBackendValidateBackendExistsCall ¶ added in v0.35.0
MockBackendValidateBackendExistsCall wrap *gomock.Call
func (*MockBackendValidateBackendExistsCall) Do ¶ added in v0.35.0
func (c *MockBackendValidateBackendExistsCall) Do(f func(context.Context, string) (bool, error)) *MockBackendValidateBackendExistsCall
Do rewrite *gomock.Call.Do
func (*MockBackendValidateBackendExistsCall) DoAndReturn ¶ added in v0.35.0
func (c *MockBackendValidateBackendExistsCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockBackendValidateBackendExistsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockBackendValidateBackendExistsCall) Return ¶ added in v0.35.0
func (c *MockBackendValidateBackendExistsCall) Return(arg0 bool, arg1 error) *MockBackendValidateBackendExistsCall
Return rewrite *gomock.Call.Return