Refactor 😮‍💨

This commit is contained in:
2024-11-26 18:28:48 -05:00
parent 7485729fd0
commit 8bcb8d3f20
17 changed files with 146 additions and 526 deletions

42
pkg/cmds/serve.go Normal file

@ -0,0 +1,42 @@
package cmd
import "github.com/urfave/cli/v2"
func NewRunCommand() *cli.Command {
return &cli.Command{
Name: "run",
Usage: "Run maps service",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "pg-host",
Usage: "Host of postgres database",
EnvVars: []string{"PG_HOST"},
Required: true,
},
&cli.IntFlag{
Name: "pg-port",
Usage: "Port of postgres database",
EnvVars: []string{"PG_PORT"},
Required: true,
},
&cli.StringFlag{
Name: "pg-db",
Usage: "Name of database to connect to",
EnvVars: []string{"PG_DB"},
Required: true,
},
&cli.StringFlag{
Name: "pg-user",
Usage: "User to connect with",
EnvVars: []string{"PG_USER"},
Required: true,
},
&cli.StringFlag{
Name: "pg-password",
Usage: "Password to connect with",
EnvVars: []string{"PG_PASSWORD"},
Required: true,
},
},
}
}