rafthttp: refactor peer and add general stream

This commit is contained in:
Yicheng Qin
2015-02-15 08:44:34 -08:00
parent 2c94e2d771
commit 1c5a507761
19 changed files with 709 additions and 794 deletions

13
rafthttp/coder.go Normal file
View File

@ -0,0 +1,13 @@
package rafthttp
import "github.com/coreos/etcd/raft/raftpb"
type encoder interface {
// encode encodes the given message to an output stream.
encode(m raftpb.Message) error
}
type decoder interface {
// decode decodes the message from an input stream.
decode() (raftpb.Message, error)
}