cmd

package
v0.0.0-...-64fca71 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HotReloadServe = &gcli.Command{
	Name:    "hotreload",
	Aliases: []string{"hot:reload"},
	UseFor:  "hot reload serve on files modified",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errors.New("TODO")
	},
}
View Source
var HttpServe = &gcli.Command{
	Name:    "serve",
	UseFor:  "start an http application serve",
	Aliases: []string{"server", "http:serve"},
	Config: func(c *gcli.Command) {

		c.StrOpt(&httpServeOpts.env, "env", "", app.EnvDev, "the application env name")
		c.BoolOpt(&httpServeOpts.debug, "debug", "", true, "the debug mode for run serve")
		c.StrOpt(&httpServeOpts.runtime, "runtime", "", "", "the runtime directory path")

		c.StrVar(&httpServeOpts.host, gcli.FlagMeta{
			Name:   "host",
			Shorts: []string{"h"},
			Desc:   "host for the start http serve",
			DefVal: "127.0.0.1",
		})
		c.IntVar(&httpServeOpts.port, gcli.FlagMeta{
			Name:   "port",
			Shorts: []string{"p"},
			Desc:   "port for the start http serve",
			DefVal: 8080,
		})
	},
	Func: func(c *gcli.Command, args []string) error {

		dump.P(httpServeOpts)

		return nil
		s := httpserve.New()

		r := s.Rux()
		r.Use(handlers.PanicsHandler())

		if httpServeOpts.debug {
			r.Use(handlers.RequestLogger())
		}

		web.AddRoutes(r)

		r.Listen("127.0.0.1:18080")

		return nil
	},
}

HttpServe Command

View Source
var SQL2MkDown = &gcli.Command{
	Name:    "sql2md",
	Aliases: []string{"sql:tomd"},
	UseFor:  "convert create table SQL to markdown table",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errors.New("TODO")
	},
}

Functions

func AddCommands

func AddCommands(app *gcli.App)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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