Пример #1
0
func makeWaddellClient(t *testing.T, waddr string) *waddell.Client {
	wc, err := waddell.NewClient(&waddell.ClientConfig{
		Dial: func() (net.Conn, error) {
			return net.Dial("tcp", waddr)
		},
	})
	if err != nil {
		t.Fatalf("Unable to connect to waddell: %s", err)
	}
	return wc
}
Пример #2
0
func connectToWaddell() {
	var err error
	wc, err = waddell.NewClient(&waddell.ClientConfig{
		Dial: func() (net.Conn, error) {
			return net.Dial("tcp", *waddellAddr)
		},
		ServerCert: *waddellCert,
	})
	if err != nil {
		log.Fatalf("Unable to connect to waddell: %s", err)
	}
	log.Printf("Connected")
	out = wc.Out(DemoTopic)
	in = wc.In(DemoTopic)
}