Example #1
0
File: utils.go Project: dnaeon/gru
// Creates a new etcd client with recording enabled
func mustNewTestClient(cassette string) *testClient {
	// Start our recorder
	r, err := recorder.New(cassette)
	if err != nil {
		panic(err)
	}

	cfg := etcdclient.Config{
		Endpoints:               []string{"http://127.0.0.1:2379"},
		Transport:               r, // Inject our transport!
		HeaderTimeoutPerRequest: etcdclient.DefaultRequestTimeout,
	}

	klient := client.NewEtcdMinionClient(cfg)

	tc := &testClient{
		client:   klient,
		config:   cfg,
		recorder: r,
	}

	return tc
}
Example #2
0
File: utils.go Project: dnaeon/gru
func newEtcdMinionClientFromFlags(c *cli.Context) client.Client {
	cfg := etcdConfigFromFlags(c)
	klient := client.NewEtcdMinionClient(cfg)

	return klient
}