create

package
v0.0.40 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdCreate = &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()
	},
}
View Source
var CmdMicro = &cobra.Command{
	Use:   "micro [name schema, schema_var]",
	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 := utilities.ModuleName()
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

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

		schema, err := prompStr("Schema")
		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) {
		name, err := prompStr("Package")
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

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

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

		err = MkMolue(name, modelo, schema)
		if err != nil {
			fmt.Printf("Command failed %v\n", err)
			return
		}
	},
}
View Source
var CmdPMicro = &cobra.Command{
	Use:   "micro [name author schema, schema_var]",
	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 := utilities.ModuleName()
		if err != nil {
			fmt.Printf("Prompt failed %v\n", err)
			return
		}

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

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

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

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

Functions

func Command

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

func MakeCmd

func MakeCmd(packageName, name string) error

func MakeDeployments

func MakeDeployments(name string) error

func MakeInternal

func MakeInternal(packageName, name string) error

func MakeModel added in v0.0.36

func MakeModel(name, modelo, schemaVar string) error

func MakePkg

func MakePkg(name, schema, schemaVar string) error

func MakeProject

func MakeProject(name string) error

func MakeRest

func MakeRest(name string) error

func MakeTest

func MakeTest(name string) error

func MakeWeb

func MakeWeb(name string) error

func MkMicroservice

func MkMicroservice(packageName, name, schema string) error

func MkMolue added in v0.0.36

func MkMolue(name, modelo, schema string) error

func MkPMicroservice

func MkPMicroservice(packageName, name, author, schema 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