Files
img-proxy-url-generator/main.go
Ron Rise 85938a2def
Some checks failed
Go Tests / build (1.22.x) (push) Failing after 1m27s
Code re-organization
2025-01-26 18:20:45 -05:00

46 lines
1.0 KiB
Go

package main
import (
cliCommands "github.com/siteworxpro/img-proxy-url-generator/commands"
"github.com/siteworxpro/img-proxy-url-generator/printer"
"github.com/urfave/cli/v2"
"os"
)
var Version = "v0.0.0"
func main() {
pr := printer.NewPrinter()
var commands []*cli.Command
commands = append(commands, cliCommands.GenerateCommand())
commands = append(commands, cliCommands.ServerCommand())
commands = append(commands, cliCommands.ReportCommand())
commands = append(commands, cliCommands.GrpcCommand())
commands = append(commands, cliCommands.DecryptCommand())
app := &cli.App{
Name: "img-proxy-url-generator",
Usage: "URL Generator for the img proxy service",
DefaultCommand: "generate",
Version: Version,
Commands: commands,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Config file to load from",
DefaultText: "imgproxy.cfg",
},
},
}
err := app.Run(os.Args)
if err != nil {
pr.LogError(err.Error())
os.Exit(1)
}
}