CLIFiles returns example client tool main implementation for each server expression in the design.
(genpkg string, root *expr.RootExpr)
| 12 | // CLIFiles returns example client tool main implementation for each server |
| 13 | // expression in the design. |
| 14 | func CLIFiles(genpkg string, root *expr.RootExpr) []*codegen.File { |
| 15 | var fw []*codegen.File |
| 16 | for _, svr := range root.API.Servers { |
| 17 | if m := exampleCLIMain(genpkg, root, svr); m != nil { |
| 18 | fw = append(fw, m) |
| 19 | } |
| 20 | } |
| 21 | return fw |
| 22 | } |
| 23 | |
| 24 | // exampleCLIMain returns an example client tool main implementation for the |
| 25 | // given server expression. |