コード例 #1
0
ファイル: proxy.go プロジェクト: qingyuancloud/qingyuan
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)
	}
}
コード例 #2
0
ファイル: qing-proxy.go プロジェクト: qingyuancloud/qingyuan
// 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
}