create

package
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdMicro = &cobra.Command{
	Use:   "micro [name schema]",
	Short: "Create project base type microservice.",
	Long:  "Template project to microservice include folder cmd, deployments, pkg, rest, test and web, with files .go required for making a microservice.",
	Run: func(cmd *cobra.Command, args []string) {
		packageName, err := utility.GoMod("module")
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		name, err := PrompStr("Name", true)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		schema, err := PrompStr("Schema", false)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		err = MkMicroservice(packageName, name, schema)
		if err != nil {
			fmt.Printf("Command failed %v\n", err)
			return
		}
	},
}
View Source
var CmdModelo = &cobra.Command{
	Use:   "modelo [name modelo, schema]",
	Short: "Create model to microservice.",
	Long:  "Template model to microservice include function handler model.",
	Run: func(cmd *cobra.Command, args []string) {
		packageName, err := PrompStr("Package", true)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		modelo, err := PrompStr("Model", true)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		schema, err := PrompStr("Schema", false)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		err = MkMolue(packageName, modelo, schema)
		if err != nil {
			fmt.Printf("Command failed %v\n", err)
			return
		}

		title := strs.Titlecase(packageName)
		message := strs.Format(`Remember, including the router, that it is on the bottom of the h%s.go, in routers section of the router.go file`, title)
		fmt.Println(message)
	},
}
View Source
var CmdProject = &cobra.Command{
	Use:   "micro [name author schema]",
	Short: "Create project base type microservice.",
	Long:  "Template project to microservice include folder cmd, deployments, pkg, rest, test and web, with files .go required for making a microservice.",
	Run: func(cmd *cobra.Command, args []string) {
		packageName, err := utility.GoMod("module")
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		name, err := PrompStr("Name", true)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		author, err := PrompStr("Author", true)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		schema, err := PrompStr("Schema", false)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		err = MkProject(packageName, name, author, schema)
		if err != nil {
			fmt.Printf("Command failed %v\n", err)
			return
		}
	},
}
View Source
var CmdRpc = &cobra.Command{
	Use:   "rpc [name]",
	Short: "Create rpc model to microservice.",
	Long:  "Template rpc model to microservice include function handler model.",
	Run: func(cmd *cobra.Command, args []string) {
		name, err := PrompStr("Package", true)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		modelo, err := PrompStr("Model", true)
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

		err = MkRpc(name, modelo)
		if err != nil {
			fmt.Printf("Command failed %v\n", err)
			return
		}
	},
}
View Source
var Create = &cobra.Command{
	Use:   "create",
	Short: "You can created Microservice.",
	Long:  "Template project to create microservice include required folders and basic files.",
	Run: func(cmd *cobra.Command, args []string) {
		PrompCreate()
	},
}

Functions

func Command

func Command(coms []string) ([][]byte, error)

func DeleteCmd added in v0.0.52

func DeleteCmd(packageName string) error

func DeleteMicroservice added in v0.0.52

func DeleteMicroservice(packageName string) error

* * *

func MakeCmd

func MakeCmd(packageName, name string) error

func MakeDeployments

func MakeDeployments(name string) error

func MakeEnv added in v0.0.73

func MakeEnv(packageName string) error

func MakeGitignore added in v0.0.175

func MakeGitignore(packageName string) error

func MakeInternal

func MakeInternal(packageName, name, schema string) error

func MakeModel added in v0.0.36

func MakeModel(packageName, modelo, schema string) error

func MakePkg

func MakePkg(name, schema string) error

func MakeProject

func MakeProject(name string) error

func MakeReadme added in v0.0.73

func MakeReadme(packageName string) error

func MakeRpc added in v0.0.44

func MakeRpc(name, modelo string) error

func MakeScripts added in v0.0.44

func MakeScripts(name string) error

func MakeTest

func MakeTest(name string) error

func MakeWWW added in v0.0.164

func MakeWWW(name string) error

func MkMicroservice

func MkMicroservice(packageName, name, schema string) error

func MkMolue added in v0.0.36

func MkMolue(packageName, modelo, schema string) error

func MkProject added in v0.0.71

func MkProject(packageName, name, author, schema string) error

func MkRpc added in v0.0.44

func MkRpc(name, modelo string) error

func ProgressInit added in v0.0.57

func ProgressInit() *progressbar.ProgressBar

func ProgressNext added in v0.0.57

func ProgressNext(step int) *progressbar.ProgressBar

func PrompCreate added in v0.0.57

func PrompCreate()

func PrompInt added in v0.0.57

func PrompInt(label string, require bool) (int, error)

func PrompStr added in v0.0.57

func PrompStr(label string, require bool) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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