Browse Source

etcdhttp: implment Peers.String()

Xiang Li 11 years ago
parent
commit
378cadf073
1 changed files with 7 additions and 1 deletions
  1. 7 1
      etcdserver/etcdhttp/http.go

+ 7 - 1
etcdserver/etcdhttp/http.go

@@ -57,7 +57,13 @@ func (ps *Peers) Set(s string) error {
 }
 
 func (ps *Peers) String() string {
-	return "todo"
+	v := url.Values{}
+	for k, vv := range *ps {
+		for i := range vv {
+			v.Add(strconv.FormatInt(k, 16), vv[i])
+		}
+	}
+	return v.Encode()
 }
 
 func (ps Peers) Ids() []int64 {