func (c *ClusterConfig) EtcdCluster(ctx scope.Context) (cluster.Cluster, error) { switch c.EtcdHost { case "": return nil, fmt.Errorf("cluster: etcd-host must be specified") case "mock": return &cluster.TestCluster{}, nil default: return etcd.EtcdCluster(ctx, c.EtcdHome, c.EtcdHost, c.DescribeSelf()) } }
func (s *EtcdServer) Join(root, id, era string) cluster.Cluster { desc := &cluster.PeerDesc{ ID: id, Era: era, } c, err := etcd.EtcdCluster(scope.New(), root, s.addr, desc) if err != nil { panic(fmt.Sprintf("error joining cluster: %s", err)) } return c }
func (c *ClusterConfig) EtcdCluster(ctx scope.Context) (cluster.Cluster, error) { if c.EtcdHost == "" { return nil, fmt.Errorf("cluster: etcd-host must be specified") } return etcd.EtcdCluster(ctx, c.EtcdHome, c.EtcdHost, c.DescribeSelf()) }