Exemplo n.º 1
0
Arquivo: utils.go Projeto: 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
}
Exemplo n.º 2
0
Arquivo: utils.go Projeto: dnaeon/gru
func newEtcdMinionClientFromFlags(c *cli.Context) client.Client {
	cfg := etcdConfigFromFlags(c)
	klient := client.NewEtcdMinionClient(cfg)

	return klient
}