func main()

in callouts/go/extproc/cmd/example/main.go [36:74]


func main() {
	exampleType := os.Getenv("EXAMPLE_TYPE")

	var customService ExampleService

	switch exampleType {
	case "redirect":
		customService = redirect.NewExampleCalloutService()
	case "add_header":
		customService = add_header.NewExampleCalloutService()
	case "add_body":
		customService = add_body.NewExampleCalloutService()
	case "basic_callout_server":
		customService = basic_callout_server.NewExampleCalloutService()
	case "jwt_auth":
		customService = jwt_auth.NewExampleCalloutService()
	case "dynamic_forwarding":
		customService = dynamic_forwarding.NewExampleCalloutService()
	default:
		fmt.Println("Unknown EXAMPLE_TYPE. Please set it to a valid example")
		return
	}

	config := server.Config{
		Address:            "0.0.0.0:8443",
		InsecureAddress:    "0.0.0.0:8181",
		HealthCheckAddress: "0.0.0.0:8000",
		CertFile:           "extproc/ssl_creds/localhost.crt",
		KeyFile:            "extproc/ssl_creds/localhost.key",
	}

	calloutServer := server.NewCalloutServer(config)
	go calloutServer.StartGRPC(customService)
	go calloutServer.StartInsecureGRPC(customService)
	go calloutServer.StartHealthCheck()

	// Block forever or handle signals as needed
	select {}
}