create

package
v1.1.59 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 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

func DeleteCmd(packageName string) error

func DeleteMicroservice

func DeleteMicroservice(packageName string) error

* * *

func MakeCmd

func MakeCmd(packageName, name string) error

func MakeDeployments

func MakeDeployments(name string) error

func MakeEnv

func MakeEnv(packageName string) error

func MakeGitignore

func MakeGitignore(packageName string) error

func MakeInternal

func MakeInternal(packageName, name, schema string) error

func MakeModel

func MakeModel(packageName, modelo, schema string) error

func MakePkg

func MakePkg(name, schema string) error

func MakeProject

func MakeProject(name string) error

func MakeReadme

func MakeReadme(packageName string) error

func MakeRpc

func MakeRpc(name, modelo string) error

func MakeScripts

func MakeScripts(name string) error

func MakeTest

func MakeTest(name string) error

func MakeWWW

func MakeWWW(name string) error

func MkMicroservice

func MkMicroservice(packageName, name, schema string) error

func MkMolue

func MkMolue(packageName, modelo, schema string) error

func MkProject

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

func MkRpc

func MkRpc(name, modelo string) error

func ProgressInit

func ProgressInit() *progressbar.ProgressBar

func ProgressNext

func ProgressNext(step int) *progressbar.ProgressBar

func PrompCreate

func PrompCreate()

func PrompInt

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

func PrompStr

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