Esempio n. 1
0
func main() {
	srcptr := flag.String("src", "", "source host")
	destptr := flag.String("dest", "", "dest host")
	modePtr := flag.String("mode", "", "r/w/rw")
	flag.Parse()

	if len(*srcptr) == 0 || len(*destptr) == 0 {
		stdlog.Println("must set -src or -dest")
		return
	}
	desthost = *destptr
	mode = *modePtr
	if len(mode) == 0 {
		stdlog.Println("must set -mode [r|w|rw]")
		return
	}

	go runloop()

	r := redis_tool.NewMonitorReader(*srcptr)
	r.DidRecvCommand = recvCommand // bind
	err := r.Connect()
	if err != nil {
		panic(err)
	}
}
Esempio n. 2
0
func main() {
	srcptr := flag.String("host", "", "host")
	flag.Parse()

	if len(*srcptr) == 0 || len(*destptr) == 0 {
		stdlog.Println("bad src or dest")
		return
	}
	desthost = *destptr

	r := redis_tool.NewMonitorReader(*srcptr)
	r.DidRecvCommand = recvCommand // bind
	err := r.Connect()
	if err != nil {
		panic(err)
	}
}