Exemplo n.º 1
0
func main() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	s := app.NewProxyServer()
	s.AddFlags(pflag.CommandLine)

	util.InitFlags()
	util.InitLogs()
	defer util.FlushLogs()

	verflag.PrintAndExitIfRequested()

	if err := s.Run(pflag.CommandLine.Args()); err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		os.Exit(1)
	}
}
Exemplo n.º 2
0
// NewQingProxy creates a new hyperqing Server object that includes the
// description and flags.
func NewQingProxy() *Server {
	s := qingproxy.NewProxyServer()

	hks := Server{
		SimpleUsage: "proxy",
		Long: `The QingYuan proxy server is responsible for taking traffic directed at
		services and forwarding it to the appropriate pods.  It generally runs on
		nodes next to the Qinglet and proxies traffic from local pods to remote pods.
		It is also used when handling incoming external traffic.`,
		Run: func(_ *Server, args []string) error {
			return s.Run(args)
		},
	}
	s.AddFlags(hks.Flags())
	return &hks
}