Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
GraphTemplates = []GraphTemplate{
{
Name: "config",
Format: "cmd/etc/app.yaml",
},
{
Name: "main",
Format: "cmd/main.go",
},
{
Name: "mod",
Format: "go.mod",
},
{
Name: "makefile",
Format: "Makefile",
},
{
Name: "readme",
Format: "README.md",
},
{
Name: "gitignore",
Format: ".gitignore",
},
}
)
View Source
var InitCmd = &cli.Command{ Name: "init", Usage: "a tool for generate woocoo web code from OpenAPI 3 specifications", Flags: []cli.Flag{ &cli.StringFlag{ Name: "package", Aliases: []string{"p"}, Usage: "the package name of the generated code", Required: true, }, &cli.StringFlag{ Name: "target", Aliases: []string{"t"}, Usage: "the target directory of the generated code", Required: true, }, &cli.StringSliceFlag{ Name: "modules", Aliases: []string{"m"}, Usage: "the modules of the generated code", }, }, Action: func(c *cli.Context) (err error) { dir := c.String("target") fd, err := filepath.Abs(dir) if err != nil { return err } cfg := &Config{ Package: c.String("package"), Target: fd, Modules: c.StringSlice("modules"), } return generateWeb(cfg) }, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type GenerateFunc ¶
The GenerateFunc type is an adapter to allow the use of ordinary function as Generator. If f is a function with the appropriate signature, GenerateFunc(f) is a Generator that calls f.
func (GenerateFunc) Generate ¶
func (f GenerateFunc) Generate(g *Graph) error
type Graph ¶
func (*Graph) Gen ¶
func (g *Graph) Gen(gf GenerateFunc) error
Gen generates the artifacts for the graph.
type GraphTemplate ¶
Click to show internal directories.
Click to hide internal directories.