Compare commits

..

1 Commits

Author SHA1 Message Date
Philippe Caseiro 67e8485958 feat(api): adding api server code
templater can be used as a commmand line tool or as an api server.
2022-06-15 14:33:10 +02:00
1 changed files with 6 additions and 6 deletions

View File

@ -25,12 +25,12 @@ func Daemon(port int) (err error) {
func main() {
var args struct {
Daemon bool `arg:"-d,--daemon,env:TEMPLATER_DAEMON" default:"false"`
Port int `arg:"-p,--port,env:TEMPLATER_PORT" default:"8080"`
Type string `arg:"-t,--type,env:TEMPLATE_TYPE" default:"hcl"`
File string `arg:"-f,--template-file,env:TEMPLATE_FILE"`
Output string `arg:"-o,--output,env:TEMPLATER_OUTPUT" default:"stdout"`
Config string `arg:"-c,--config,env:TEMPLATE_CONFIG"`
Daemon bool `arg:"-d,--daemon,env:TEMPLATER_DAEMON" default:"false" help:"Enable api server"`
Port int `arg:"-p,--port,env:TEMPLATER_PORT" default:"8080" help:"Listening port for the api server"`
Type string `arg:"-t,--type,env:TEMPLATE_TYPE" default:"hcl" help:"Template type (go/template or hcl)"`
Output string `arg:"-o,--output,env:TEMPLATER_OUTPUT" default:"stdout" help:"Destination of the result (stdout or file path)"`
Config string `arg:"-c,--config,env:TEMPLATE_CONFIG" help:"Configuration values"`
File string `arg:"-f,--template-file,env:TEMPLATE_FILE" help:"Template file path"`
}
arg.MustParse(&args)