commands

package
v0.0.0-...-24cf382 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2022 NAME HERE abolfazl.beh@gmail.com

Index

Constants

View Source
const (
	DefaultProjectDirectory = "."

	InitializeMessage         = `Zhycan > Create project skeleton ...`
	RootDirectoryIsCreated    = `Zhycan > Project root (%s) is created ...`
	RootDirectoryIsNotCreated = `Zhycan > Project root (%s) is not created correctly ...%v`
	GoModuleFileIsCreated     = `Zhycan > Go Module File "go.mod" is created ...`
	GoModuleFileIsNotCreated  = `Zhycan > Go Module File "go.mod" is not created ... %v`
	GoModuleIsCreated         = `Zhycan > Go Module "go.mod" is filled ...`
	GoModuleIsNotCreated      = `Zhycan > Go Module "go.mod" is not filled ... %v`
	MainGoFileIsCreated       = `Zhycan > Main program File "main.go" is created ...`
	MainGoFileIsNotCreated    = `Zhycan > Main program File "main.go" is not created ... %v`
	MainGoIsCreated           = `Zhycan > Main program "main.go" is filled ...`
	MainGoIsNotCreated        = `Zhycan > Main program "main.go" is not filled ... %v`
	UserExisted               = "Zhycan > User existed ..."
	UserNotExisted            = "Zhycan > User not existed ... %v"
	SubDirectoryIsNotCreated  = `Zhycan > Sub directory "%s" cannot be created ... %v`
	SubDirectoryIsCreated     = `Zhycan > Sub directory "%s" is created ...`
	AppControllerIsNotCreated = `Zhycan > App "controller.go" cannot be created ... %v`
	AppControllerIsCreated    = `Zhycan > App "controller.go" is created ...`
	AppModelIsNotCreated      = `Zhycan > App "model.go" cannot be created ... %v`
	AppModelIsCreated         = `Zhycan > App "model.go" is created ...`
	AppEngineIsNotCreated     = `Zhycan > App "app.go" cannot be created ... %v`
	AppEngineIsCreated        = `Zhycan > App "app.go" is created ...`

	RootCommandGoFileIsCreated    = `Zhycan > Root command File "commands/root.go" is created ...`
	RootCommandGoFileIsNotCreated = `Zhycan > Root command File "commands/root.go" is not created ... %v`
	RootCommandGoIsNotCreated     = `Zhycan > Root command "commands/root.go" is not filled ... %v`

	GitIgnoreFileIsCreated    = `Zhycan > Git Ignore File ".gitignore" is created ...`
	GitIgnoreFileIsNotCreated = `Zhycan > Git Ignore File ".gitignore" is not created ... %v`
	GitIgnoreIsNotCreated     = `Zhycan > Git Ignore ".gitignore" is not filled ... %v`

	GitInitExecutedError = `Zhycan > Cannot execute git init command ... %v`
	GitInitExecuted      = `Zhycan > Git repository is initialized ...`

	ConfigFileIsCreated       = `Zhycan > Config File "%s" is created ...`
	ConfigFileIsNotCreated    = `Zhycan > Config File "%s" is not created ... %v`
	ConfigDevFileIsCreated    = `Zhycan > Config File "%s" is created for "dev" mode ...`
	ConfigDevFileIsNotCreated = `Zhycan > Config File "%s" is not created for "dev" mode ... %v`

	GoModTidyExecutedError = `Zhycan > Cannot execute go mod tidy command ... %v`
	GoModTidyExecuted      = `Zhycan > "go mod tidy" command is executed ...`

	GreeterProtobufIsNotCreated = `Zhycan > App "greeter.proto" cannot be created ... %v`
	GreeterProtobufIsCreated    = `Zhycan > App "greeter.proto" is created ...`
)
View Source
const (
	InitializeCreateCommandMessage       = `Zhycan > Create A New Command`
	CannotGetCurrentDirectoryMessage     = `Zhycan > Cannot current working directory ... %v`
	CannotCreateCommandsDirectoryMessage = `Zhycan > Cannot create commands directory ... %v`
	CannotCreateCommandFileMessage       = `Zhycan > Cannot create command file: %v ... %v`
	CannotFillCommandFileMessage         = `Zhycan > Cannot fill command file: %v ... %v`
	CommandFileCreatedMessage            = `Zhycan > Command file is created: %v`
)
View Source
const (
	CommandDirectory = "commands"
)

Variables

View Source
var ExpectedConfigContentTmpl = func() map[string]string {
	return map[string]string{
		"base":   baseConfigTmpl,
		"logger": loggerConfigTmpl,
		"http":   httpConfigTmpl,
	}
}
View Source
var ExpectedConfigFiles = func() []string {
	return []string{"base", "logger"}
}
View Source
var ExpectedSubDirectories = func() []string {
	return []string{"app", "commands", ".git", "configs"}
}

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewCreateCmd

func NewCreateCmd() *cobra.Command

func NewCreateCommandCmd

func NewCreateCommandCmd() *cobra.Command

func NewInitCmd

func NewInitCmd() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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