rafthttp: remove raftPrefix

This commit is contained in:
Xiang Li 2014-12-30 13:48:07 -08:00
parent 2193b70fb3
commit d2c7a7e5cb

View File

@ -14,10 +14,6 @@ import (
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
)
const (
raftPrefix = "/raft"
)
type Raft interface {
Process(ctx context.Context, m raftpb.Message) error
}
@ -119,7 +115,7 @@ func (t *transport) AddPeer(id types.ID, urls []string) {
if err != nil {
log.Panicf("unexpect peer url %s", peerURL)
}
u.Path = path.Join(u.Path, raftPrefix)
u.Path = path.Join(u.Path, RaftPrefix)
fs := t.leaderStats.Follower(id.String())
t.peers[id] = NewPeer(t.roundTripper, u.String(), id, t.clusterID,
t.raft, fs, t.shouldstop)
@ -144,7 +140,7 @@ func (t *transport) UpdatePeer(id types.ID, urls []string) {
if err != nil {
log.Panicf("unexpect peer url %s", peerURL)
}
u.Path = path.Join(u.Path, raftPrefix)
u.Path = path.Join(u.Path, RaftPrefix)
t.peers[id].Update(u.String())
}