initcmd

package
v1.229.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package initcmd is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitCommandProvider

type InitCommandProvider struct{}

InitCommandProvider implements the CommandProvider interface.

func (*InitCommandProvider) GetAliases

func (i *InitCommandProvider) GetAliases() []internal.CommandAlias

GetAliases returns command aliases for the init command.

func (*InitCommandProvider) GetCommand

func (i *InitCommandProvider) GetCommand() *cobra.Command

GetCommand returns the init command.

func (*InitCommandProvider) GetCompatibilityFlags

func (i *InitCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag

GetCompatibilityFlags returns compatibility flags for this command. Init command has no compatibility flags.

func (*InitCommandProvider) GetFlagsBuilder

func (i *InitCommandProvider) GetFlagsBuilder() flags.Builder

GetFlagsBuilder returns the flags builder for this command. Init command flags are defined in cobra directly.

func (*InitCommandProvider) GetGroup

func (i *InitCommandProvider) GetGroup() string

GetGroup returns the command group for help organization.

func (*InitCommandProvider) GetName

func (i *InitCommandProvider) GetName() string

GetName returns the command name.

func (*InitCommandProvider) GetPositionalArgsBuilder

func (i *InitCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder

GetPositionalArgsBuilder returns the positional args builder for this command. Init command has no positional args builder.

func (*InitCommandProvider) IsExperimental

func (i *InitCommandProvider) IsExperimental() bool

IsExperimental returns whether this command is experimental. Init ships as experimental while the project-template catalog and update workflow mature; behavior may change between releases.

type InitUI

type InitUI interface {
	SetConflictStrategy(strategy merge.ConflictStrategy)
	SetMergeDriver(driver merge.Driver)
	SetSkipHooks(skip func(string) bool)
	PromptForTemplate(templateType string, templates interface{}) (string, error)
	ExecuteWithBaseRef(embedsConfig *templates.Configuration, targetPath string, force, update, useDefaults bool, baseRef string, cmdTemplateValues map[string]interface{}) error
	ExecuteWithInteractiveFlowAndBaseRefResult(embedsConfig *templates.Configuration, targetPath string, force, update, useDefaults bool, baseRef string, cmdTemplateValues map[string]interface{}) (string, error)
	ResolveTargetPath(embedsConfig *templates.Configuration, targetPath string, update, useDefaults bool, cmdTemplateValues map[string]interface{}) (string, map[string]interface{}, bool, error)
	ConfirmUpdateInstead(targetPath string) (bool, error)
}

InitUI is the subset of *generatorUI.InitUI's behavior the init command depends on, extracted so tests can substitute a mock instead of driving the real interactive TUI (prompts, huh forms) end to end. Mirrors cmd/scaffold's ScaffoldUI, which solves the same problem for the sibling command.

type MockInitUI

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

MockInitUI is a mock of InitUI interface.

func NewMockInitUI

func NewMockInitUI(ctrl *gomock.Controller) *MockInitUI

NewMockInitUI creates a new mock instance.

func (*MockInitUI) ConfirmUpdateInstead

func (m *MockInitUI) ConfirmUpdateInstead(targetPath string) (bool, error)

ConfirmUpdateInstead mocks base method.

func (*MockInitUI) EXPECT

func (m *MockInitUI) EXPECT() *MockInitUIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInitUI) ExecuteWithBaseRef

func (m *MockInitUI) ExecuteWithBaseRef(embedsConfig *templates.Configuration, targetPath string, force, update, useDefaults bool, baseRef string, cmdTemplateValues map[string]any) error

ExecuteWithBaseRef mocks base method.

func (*MockInitUI) ExecuteWithInteractiveFlowAndBaseRefResult

func (m *MockInitUI) ExecuteWithInteractiveFlowAndBaseRefResult(embedsConfig *templates.Configuration, targetPath string, force, update, useDefaults bool, baseRef string, cmdTemplateValues map[string]any) (string, error)

ExecuteWithInteractiveFlowAndBaseRefResult mocks base method.

func (*MockInitUI) PromptForTemplate

func (m *MockInitUI) PromptForTemplate(templateType string, arg1 any) (string, error)

PromptForTemplate mocks base method.

func (*MockInitUI) ResolveTargetPath

func (m *MockInitUI) ResolveTargetPath(embedsConfig *templates.Configuration, targetPath string, update, useDefaults bool, cmdTemplateValues map[string]any) (string, map[string]any, bool, error)

ResolveTargetPath mocks base method.

func (*MockInitUI) SetConflictStrategy

func (m *MockInitUI) SetConflictStrategy(strategy merge.ConflictStrategy)

SetConflictStrategy mocks base method.

func (*MockInitUI) SetMergeDriver

func (m *MockInitUI) SetMergeDriver(driver merge.Driver)

SetMergeDriver mocks base method.

func (*MockInitUI) SetSkipHooks

func (m *MockInitUI) SetSkipHooks(skip func(string) bool)

SetSkipHooks mocks base method.

type MockInitUIMockRecorder

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

MockInitUIMockRecorder is the mock recorder for MockInitUI.

func (*MockInitUIMockRecorder) ConfirmUpdateInstead

func (mr *MockInitUIMockRecorder) ConfirmUpdateInstead(targetPath any) *gomock.Call

ConfirmUpdateInstead indicates an expected call of ConfirmUpdateInstead.

func (*MockInitUIMockRecorder) ExecuteWithBaseRef

func (mr *MockInitUIMockRecorder) ExecuteWithBaseRef(embedsConfig, targetPath, force, update, useDefaults, baseRef, cmdTemplateValues any) *gomock.Call

ExecuteWithBaseRef indicates an expected call of ExecuteWithBaseRef.

func (*MockInitUIMockRecorder) ExecuteWithInteractiveFlowAndBaseRefResult

func (mr *MockInitUIMockRecorder) ExecuteWithInteractiveFlowAndBaseRefResult(embedsConfig, targetPath, force, update, useDefaults, baseRef, cmdTemplateValues any) *gomock.Call

ExecuteWithInteractiveFlowAndBaseRefResult indicates an expected call of ExecuteWithInteractiveFlowAndBaseRefResult.

func (*MockInitUIMockRecorder) PromptForTemplate

func (mr *MockInitUIMockRecorder) PromptForTemplate(templateType, arg1 any) *gomock.Call

PromptForTemplate indicates an expected call of PromptForTemplate.

func (*MockInitUIMockRecorder) ResolveTargetPath

func (mr *MockInitUIMockRecorder) ResolveTargetPath(embedsConfig, targetPath, update, useDefaults, cmdTemplateValues any) *gomock.Call

ResolveTargetPath indicates an expected call of ResolveTargetPath.

func (*MockInitUIMockRecorder) SetConflictStrategy

func (mr *MockInitUIMockRecorder) SetConflictStrategy(strategy any) *gomock.Call

SetConflictStrategy indicates an expected call of SetConflictStrategy.

func (*MockInitUIMockRecorder) SetMergeDriver

func (mr *MockInitUIMockRecorder) SetMergeDriver(driver any) *gomock.Call

SetMergeDriver indicates an expected call of SetMergeDriver.

func (*MockInitUIMockRecorder) SetSkipHooks

func (mr *MockInitUIMockRecorder) SetSkipHooks(skip any) *gomock.Call

SetSkipHooks indicates an expected call of SetSkipHooks.

Jump to

Keyboard shortcuts

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