Documentation ¶
Index ¶
- Constants
- Variables
- func DeprecateCmd(parentCmd *cobra.Command, deprecatedCmd, deprecatedMsg string)
- func FormulaWorkspaceInput(workspaces formula.Workspaces, inList prompt.InputList, ...) (formula.Workspace, error)
- func IsFlagInput(cmd *cobra.Command) bool
- func NewAddCmd() *cobra.Command
- func NewAddRepoCmd(repo formula.RepositoryAddLister, repoProviders formula.RepoProviders, ...) *cobra.Command
- func NewAddWorkspaceCmd(workspace formula.WorkspaceAddLister, input prompt.InputTextValidator, ...) *cobra.Command
- func NewAutocompleteBash(g autocomplete.Generator) *cobra.Command
- func NewAutocompleteCmd() *cobra.Command
- func NewAutocompleteFish(g autocomplete.Generator) *cobra.Command
- func NewAutocompletePowerShell(g autocomplete.Generator) *cobra.Command
- func NewAutocompleteZsh(g autocomplete.Generator) *cobra.Command
- func NewBuildCmd() *cobra.Command
- func NewBuildFormulaCmd() *cobra.Command
- func NewCreateCmd() *cobra.Command
- func NewCreateFormulaCmd(homeDir string, formula formula.CreateBuilder, tplM template.Manager, ...) *cobra.Command
- func NewDeleteCmd() *cobra.Command
- func NewDeleteCredentialCmd(credDelete credential.CredDelete, credReader credential.ReaderPather, ...) *cobra.Command
- func NewDeleteEnvCmd(fr env.FindRemover, ib prompt.InputBool, il prompt.InputList) *cobra.Command
- func NewDeleteFormulaCmd(userHomeDir string, ritchieHomeDir string, ...) *cobra.Command
- func NewDeleteRepoCmd(rl formula.RepositoryLister, il prompt.InputList, ib prompt.InputBool, ...) *cobra.Command
- func NewDeleteWorkspaceCmd(userHomeDir string, workspace formula.WorkspaceListDeleter, ...) *cobra.Command
- func NewInitCmd(repo formula.RepositoryAdder, git git.Repositories, tutorial rtutorial.Finder, ...) *cobra.Command
- func NewListCmd() *cobra.Command
- func NewListCredentialCmd(ss credential.ReaderWriterPather) *cobra.Command
- func NewListFormulaCmd(rl formula.RepositoryLister, il prompt.InputList, tm formula.TreeManager, ...) *cobra.Command
- func NewListRepoCmd(rl formula.RepositoryLister, rtf rtutorial.Finder) *cobra.Command
- func NewListWorkspaceCmd(wl formula.WorkspaceLister, rtf rtutorial.Finder) *cobra.Command
- func NewMetricsCmd(file stream.FileWriteReadExister, inList prompt.InputList) *cobra.Command
- func NewRenameCmd() *cobra.Command
- func NewRenameFormulaCmd(workspace formula.WorkspaceAddListHasher, inList prompt.InputList, ...) *cobra.Command
- func NewRootCmd(ritchieHome string, dir stream.DirCreateChecker, ...) *cobra.Command
- func NewSetCmd() *cobra.Command
- func NewSetCredentialCmd(credSetter credential.Setter, credFile credential.ReaderWriterPather, ...) *cobra.Command
- func NewSetEnvCmd(fs renv.FindSetter, it prompt.InputText, il prompt.InputList) *cobra.Command
- func NewSetFormulaRunnerCmd(c formula.ConfigRunner, i prompt.InputList) *cobra.Command
- func NewSetPriorityCmd(inList prompt.InputList, inInt prompt.InputInt, ...) *cobra.Command
- func NewShowCmd() *cobra.Command
- func NewShowEnvCmd(f env.Finder) *cobra.Command
- func NewShowFormulaRunnerCmd(c formula.ConfigRunner) *cobra.Command
- func NewTutorialCmd(il prompt.InputList, tt rtutorial.FindSetter) *cobra.Command
- func NewUpdateCmd() *cobra.Command
- func NewUpdateRepoCmd(client *http.Client, repo formula.RepositoryListUpdater, ...) *cobra.Command
- func NewUpdateWorkspaceCmd(workspace formula.WorkspaceListUpdater, inList prompt.InputList) *cobra.Command
- func NewUpgradeCmd(r version.Resolver, m upgrade.Manager, uf upgrade.UrlFinder, ...) *cobra.Command
- func WorkspaceListInput(workspaces formula.Workspaces, inList prompt.InputList) (formula.Workspace, error)
- type ByCmd
- type CommandRunnerFunc
- type FormulaCommand
- type UpgradeCmd
Constants ¶
View Source
const CommonsRepoURL = "https://github.com/ZupIT/ritchie-formulas"
View Source
const (
Group = "group"
)
Variables ¶
View Source
var ( ErrFormulaCmdNotBeEmpty = errors.New("this input must not be empty") ErrFormulaCmdMustStartWithRit = errors.New("rit formula's command needs to start with \"rit\" [ex.: rit group verb <noun>]") ErrInvalidFormulaCmdSize = errors.New("rit formula's command needs at least 2 words following \"rit\" [ex.: rit group verb]") ErrInvalidCharactersFormulaCmd = errors.New(`these characters are not allowed in the formula command [\ /,> <@ -]`) InvalidWorkspace = "the workspace path informed doesn't exist. Do you want to create it?" )
View Source
var ( NoDefinedEnvsMsg = "You have no defined envs" DeleteEnvSuccessMsg = "Delete env successful!" )
View Source
var ( ErrCouldNotFindFormula = errors.New(msgFormulaNotFound) ErrIncorrectFormulaName = errors.New(msgIncorrectFormulaName) )
View Source
var ( FormulaLocalRunWarning = i18n.T("init.run.type.local.warning") AddTheCommunityRepo = i18n.T("init.add.commons.repo.question") SelectFormulaTypeQuestion = i18n.T("init.run.type.question") AgreeSendMetrics = i18n.T("init.add.metric.question") AcceptOpt = i18n.T("input.accept.opt") DeclineOpt = i18n.T("input.decline.opt") LocalRunType = i18n.T("input.run.type.local") DockerRunType = i18n.T("input.run.type.docker") AcceptDeclineOpts = []string{AcceptOpt, DeclineOpt} RunTypes = []string{LocalRunType, DockerRunType} ErrInitCommonsRepo = errors.New(errMsg) ErrInvalidRunType = errors.New(i18n.T("init.invalid.run.type.error", strings.Join(formula.RunnerTypes, ", "))) )
View Source
var ( Version = "" BuildDate = "unknown" MsgInit = "To start using rit, you need to initialize rit first.\nCommand: rit init" )
View Source
var ErrEmptyWorkspace = errors.New("there is no workspace to update")
View Source
var ErrEmptyWorkspaces = errors.New("there are no workspaces to delete")
View Source
var ErrRepoNameNotEmpty = errors.New("the field repository name must not be empty")
View Source
var ErrRunFormulaWithTwoFlag = errors.New("you cannot run formula with --docker and --local flags together")
Functions ¶
func DeprecateCmd ¶
func FormulaWorkspaceInput ¶
func IsFlagInput ¶
func NewAddRepoCmd ¶
func NewAddRepoCmd( repo formula.RepositoryAddLister, repoProviders formula.RepoProviders, resolver credential.Resolver, inText prompt.InputTextValidator, inURL prompt.InputURL, inList prompt.InputList, inBool prompt.InputBool, inInt prompt.InputInt, rtf rtutorial.Finder, treeChecker tree.CheckerManager, rd formula.RepositoryDetail, ) *cobra.Command
func NewAddWorkspaceCmd ¶
func NewAddWorkspaceCmd( workspace formula.WorkspaceAddLister, input prompt.InputTextValidator, inPath prompt.InputPath, ) *cobra.Command
func NewAutocompleteBash ¶
func NewAutocompleteBash(g autocomplete.Generator) *cobra.Command
NewAutocompleteBash creates a new cmd instance zsh.
func NewAutocompleteCmd ¶
NewAutocompleteCmd creates a new cmd instance.
func NewAutocompleteFish ¶
func NewAutocompleteFish(g autocomplete.Generator) *cobra.Command
NewAutocompleteFish creates a new cmd instance fish.
func NewAutocompletePowerShell ¶
func NewAutocompletePowerShell(g autocomplete.Generator) *cobra.Command
NewAutocompletePowerShell creates a new cmd instance PowerShell.
func NewAutocompleteZsh ¶
func NewAutocompleteZsh(g autocomplete.Generator) *cobra.Command
NewAutocompleteZsh creates a new cmd instance zsh.
func NewBuildCmd ¶
func NewBuildFormulaCmd ¶
func NewCreateFormulaCmd ¶
func NewCreateFormulaCmd( homeDir string, formula formula.CreateBuilder, tplM template.Manager, workspace formula.WorkspaceAddListHasher, inText prompt.InputText, inTextValidator prompt.InputTextValidator, inList prompt.InputList, inPath prompt.InputPath, rtf rtutorial.Finder, treeChecker formula.TreeChecker, validator validator.Manager, inputBool prompt.InputBool, dirMan stream.DirCreater, ) *cobra.Command
NewCreateFormulaCmd creates a new cmd instance.
func NewDeleteCredentialCmd ¶
func NewDeleteCredentialCmd( credDelete credential.CredDelete, credReader credential.ReaderPather, env env.Finder, inBool prompt.InputBool, inList prompt.InputList, ) *cobra.Command
NewDeleteCredentialCmd creates a new cmd instance
func NewDeleteEnvCmd ¶
func NewDeleteFormulaCmd ¶
func NewDeleteFormulaCmd( userHomeDir string, ritchieHomeDir string, workspace formula.WorkspaceAddLister, directory stream.DirListChecker, inBool prompt.InputBool, inTextValidator prompt.InputTextValidator, inList prompt.InputList, inPath prompt.InputPath, treeGen formula.TreeGenerator, fileManager stream.FileWriteRemover, ) *cobra.Command
func NewDeleteRepoCmd ¶
func NewDeleteRepoCmd( rl formula.RepositoryLister, il prompt.InputList, ib prompt.InputBool, rd formula.RepositoryDeleter, ) *cobra.Command
func NewDeleteWorkspaceCmd ¶
func NewInitCmd ¶
func NewInitCmd( repo formula.RepositoryAdder, git git.Repositories, tutorial rtutorial.Finder, config formula.ConfigRunner, file stream.FileWriter, inList prompt.InputList, inBool prompt.InputBool, metricSender metric.SendManagerHttp, ritConfig config.Writer, ) *cobra.Command
func NewListCredentialCmd ¶
func NewListCredentialCmd(ss credential.ReaderWriterPather) *cobra.Command
func NewListFormulaCmd ¶
func NewListFormulaCmd( rl formula.RepositoryLister, il prompt.InputList, tm formula.TreeManager, rtf rtutorial.Finder, ) *cobra.Command
func NewListRepoCmd ¶
func NewListWorkspaceCmd ¶
func NewMetricsCmd ¶
func NewRenameFormulaCmd ¶
func NewRenameFormulaCmd( workspace formula.WorkspaceAddListHasher, inList prompt.InputList, inTextValidator prompt.InputTextValidator, inBool prompt.InputBool, directory stream.DirManager, validator validator.Manager, formula formula.CreateBuilder, treeGen formula.TreeGenerator, deleter deleter.DeleteManager, userHomeDir string, ritHomeDir string, ) *cobra.Command
New renameFormulaCmd rename a cmd instance.
func NewRootCmd ¶
func NewRootCmd( ritchieHome string, dir stream.DirCreateChecker, file stream.FileWriteReadExistRemover, tutorial rtutorial.Finder, version version.Manager, tree formula.TreeGenerator, repo formula.RepositoryListWriter, ) *cobra.Command
func NewSetCredentialCmd ¶
func NewSetCredentialCmd( credSetter credential.Setter, credFile credential.ReaderWriterPather, inText prompt.InputText, inBool prompt.InputBool, inList prompt.InputList, inPass prompt.InputPassword, ) *cobra.Command
NewSetCredentialCmd creates a new cmd instance.
func NewSetEnvCmd ¶
func NewSetFormulaRunnerCmd ¶
func NewSetPriorityCmd ¶
func NewSetPriorityCmd( inList prompt.InputList, inInt prompt.InputInt, repoLister formula.RepositoryLister, repoPriority formula.RepositoryPrioritySetter, ) *cobra.Command
func NewShowCmd ¶
func NewShowFormulaRunnerCmd ¶
func NewShowFormulaRunnerCmd(c formula.ConfigRunner) *cobra.Command
func NewTutorialCmd ¶
NewTutorialCmd creates tutorial command.
func NewUpdateRepoCmd ¶
func NewUpdateWorkspaceCmd ¶
func NewUpgradeCmd ¶
func WorkspaceListInput ¶
Types ¶
type CommandRunnerFunc ¶
CommandRunnerFunc represents that runner func for commands.
func RunFuncE ¶
func RunFuncE(stdinFunc, promptFunc CommandRunnerFunc) CommandRunnerFunc
RunFuncE delegates to stdinFunc if --stdin flag is passed otherwise delegates to promptFunc.
type FormulaCommand ¶
type FormulaCommand struct {
// contains filtered or unexported fields
}
func NewFormulaCommand ¶
func NewFormulaCommand( coreCmds api.Commands, treeManager formula.TreeManager, formula formula.Executor, file stream.FileReader, ) *FormulaCommand
Source Files ¶
- add.go
- add_repo.go
- add_workspace.go
- autocomplete.go
- build.go
- build_formula.go
- cmd.go
- create.go
- create_formula.go
- delete.go
- delete_credential.go
- delete_env.go
- delete_formula.go
- delete_repo.go
- delete_workspace.go
- formula.go
- init.go
- list.go
- list_credential.go
- list_formula.go
- list_repo.go
- list_workspace.go
- metrics.go
- rename.go
- rename_formula.go
- root.go
- set.go
- set_credential.go
- set_env.go
- set_formula_runner.go
- set_priority.go
- show.go
- show_env.go
- show_formula_runner.go
- tutorial.go
- update.go
- update_repo.go
- update_workspace.go
- upgrade.go
Click to show internal directories.
Click to hide internal directories.