示例#1
0
文件: client.go 项目: fkasper/core
func NewClient(key string) *Client {
	etcd := etcd.NewClient([]string{etcdMachine})

	etcd.SyncCluster()

	return &Client{Key: key, etcd: etcd}
}
示例#2
0
文件: registry.go 项目: fkasper/core
func NewRegistry(config Config, hosts []string) *Registry {
	return &Registry{
		etcdClient: etcd.NewClient(hosts),
		config:     config,
	}
}
示例#3
0
func (s *ClientSuite) SetUpSuite(c *C) {
	machines := []string{"http://127.0.0.1:4001"}
	s.etcd = etcd.NewClient(machines)
	s.client = NewClient("clienttest")
}
示例#4
0
文件: registry.go 项目: fkasper/core
func NewRegistry(config Config) *Registry {
	return &Registry{
		etcdClient: etcd.NewClient([]string{"http://127.0.0.1:4001"}),
		config:     config,
	}
}