Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DummyCommand = cli.Command{ Name: "util-dummy", Usage: "dummy util command", Action: func(c *cli.Context) { println("util command is working!") }, }
DummyCommand for test if the package is working
View Source
var ServeStaticCommand = cli.Command{ Name: "static", Usage: "serve static files", Flags: []cli.Flag{ cli.IntFlag{ Name: "port", Value: 8888, Usage: "the port to listen on", }, }, Action: func(c *cli.Context) { viper.SetDefault("base", ".") viper.Set("port", c.Int("port")) ServeStatic() }, }
ServeStaticCommand serve static file in current folder
Functions ¶
func ByteIndex ¶
ByteIndex is copied from https://golang.org/src/net/parser.go
func RemoveLine ¶
RemoveLine will remove one line from file, line number starts from 1
func ServeStatic ¶
func ServeStatic()
ServeStatic start a static server use folder as public directory on port
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.