template

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TemplateAngular template = "angular"
	TemplateASPNET  template = "aspnet"
	TemplateGolang  template = "golang"
	TemplateNginx   template = "nginx"
	TemplatePack    template = "pack"
	TemplatePython  template = "python"
	TemplateReact   template = "react"
	TemplateSpring  template = "spring"
)
View Source
var Command = &cli.Command{
	Name:  "template",
	Usage: "create new applications from template",

	HideHelpCommand: true,

	Category: app.CategoryUtilities,

	Subcommands: []*cli.Command{
		{
			Name:  "react",
			Usage: "create React web app",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Usage:    "package name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Name: c.String("name"),
				}

				return runTemplate(c.Context, "", TemplateReact, options)
			},
		},
		{
			Name:  "angular",
			Usage: "create Angular app",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Usage:    "package name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Name: c.String("name"),
				}

				return runTemplate(c.Context, "", TemplateAngular, options)
			},
		},
		{
			Name:  "golang",
			Usage: "create Go web app",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Usage:    "module name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Name: c.String("name"),
				}

				return runTemplate(c.Context, "", TemplateGolang, options)
			},
		},
		{
			Name:  "python",
			Usage: "create Python web app",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Usage:    "app name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Name: c.String("name"),
				}

				return runTemplate(c.Context, "", TemplatePython, options)
			},
		},
		{
			Name:  "spring",
			Usage: "create Java Spring web app",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "group",
					Usage:    "application group",
					Required: true,
				},
				&cli.StringFlag{
					Name:     "name",
					Usage:    "application name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Group: c.String("group"),
					Name:  c.String("name"),
				}

				return runTemplate(c.Context, "", TemplateSpring, options)
			},
		},
		{
			Name:  "aspnet",
			Usage: "create ASP.NET Core app",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Usage:    "application name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Name: c.String("name"),
				}

				return runTemplate(c.Context, "", TemplateASPNET, options)
			},
		},

		{
			Name:  "nginx",
			Usage: "create Nginx web app",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Usage:    "app name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Name: c.String("name"),
				}

				return runTemplate(c.Context, "", TemplateNginx, options)
			},
		},
		{
			Name:  "pack",
			Usage: "create app using buildpacks",

			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Usage:    "app name",
					Required: true,
				},
			},

			Action: func(c *cli.Context) error {
				options := templateOptions{
					Name: c.String("name"),
				}

				return runTemplate(c.Context, "", TemplatePack, options)
			},
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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