Documentation ¶
Index ¶
Constants ¶
View Source
const TEMPLATE_GAE_APP_YAML = `` /* 137-byte string literal not displayed */
View Source
const TEMPLATE_GAE_MAIN_GO = `` /* 311-byte string literal not displayed */
View Source
const TEMPLATE_MAIN_GO = `` /* 787-byte string literal not displayed */
Variables ¶
View Source
var CmdGenerate = cli.Command{ Name: "generate", ShortName: "gen", Description: "Generate a application directory to start a new project", Usage: `direcrtoy`, Flags: []cli.Flag{ cli.StringFlag{"environment, e", "local", "environment name ('local' or 'gae' is available)", "WCG_ENV"}, cli.BoolFlag{"no-accesslog", "including access log support", "NO_ACCESS_LOG"}, cli.BoolFlag{"no-static", "including static file support", "NO_STATIC"}, cli.BoolFlag{"skip-directory-check", "Skip directory check", "SKIP_DIRECTORY_CHECK"}, }, Action: func(c *cli.Context) { if len(c.Args()) != 1 { fmt.Fprintf(os.Stderr, "A directory path is required in arguments\n") cli.ShowCommandHelp(c, "generate") } else { err := generateAppDir(c.Args()[0], c) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) os.Exit(1) } fmt.Printf("Your WCG project is successfully created!\n") os.Exit(0) } }, }
View Source
var CmdSign = cli.Command{ Name: "sign", ShortName: "s", Usage: "Sign a value", Flags: []cli.Flag{ cli.StringFlag{"key, k", "wcgsess", "secret key", "KEY"}, }, Action: func(c *cli.Context) { if len(c.Args()) != 1 { cli.ShowCommandHelp(c, "sign") } else { val := c.Args().First() key := c.String("key") fmt.Printf("%s\n", wcg.Sign(val, key)) } }, }
View Source
var CmdUnsign = cli.Command{ Name: "unsign", ShortName: "u", Usage: "Unsign a value", Flags: []cli.Flag{ cli.StringFlag{"key, k", "wcgsess", "secret key", "KEY"}, }, Action: func(c *cli.Context) { if len(c.Args()) != 1 { cli.ShowCommandHelp(c, "unsign") } else { val := c.Args().First() key := c.String("key") val2, err := wcg.Unsign(val, key) if err != nil { fmt.Fprintf(os.Stderr, "Could not unsign the value: %q\n", err) os.Exit(1) } else { fmt.Printf("%s\n", val2) } } }, }
Functions ¶
func ExecCommand ¶
Execute a tool command with specified arguments
func ExecCommandEx ¶
Execute a tool command and return stdout. It would panic if the command fails, .
func ExecToolEx ¶
Short hand to execute tool command with panic.
func StartCommand ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.