INNER CODE UNIT · Go
main
envoyproxy/ai-gateway · cmd/aigw/main.go:169
func main() {
doMain(ctrl.SetupSignalHandler(), os.Stdout, os.Stderr, os.Args[1:], os.Exit, run, healthcheck, downloadEnvoyCmd)
}
// doMain is the main entry point for the CLI. It parses the command line arguments and executes the appropriate command.
//
// - stdout is the writer to use for standard output. Mainly for testing.
// - stderr is the writer to use for standard error. Mainly for testing.
// - `args` are the command line arguments without the program name.
// - exitFn is the function to call to exit the program during the parsing of the command line arguments. Mainly for testing.
// - rf is the function to call to run the AI Gateway locally. Mainly for testing.
func doMain(ctx context.Context, stdout, stderr io.Writer, args []string, exitFn func(int),
rf runFn,
hf healthcheckFn,
df downloadEnvoyFn,
) {
var c cmd
parser, err := kong.New(&c,