Documentation ¶
Index ¶
- Constants
- Variables
- func NewHandler(r Raft, cid types.ID) http.Handler
- func NewPeer(tr http.RoundTripper, u string, id types.ID, cid types.ID, r Raft, ...) *peer
- func NewStreamHandler(tr *transport, id, cid types.ID) http.Handler
- type Batcher
- type Pausable
- type ProposalBatcher
- type Raft
- type Transporter
- type WriteFlusher
Constants ¶
View Source
const ( ConnReadTimeout = 5 * time.Second ConnWriteTimeout = 5 * time.Second )
View Source
const (
ConnReadLimitByte = 64 * 1024
)
Variables ¶
View Source
var ( RaftPrefix = "/raft" RaftStreamPrefix = path.Join(RaftPrefix, "stream") )
Functions ¶
Types ¶
type ProposalBatcher ¶
func NewProposalBatcher ¶
func NewProposalBatcher(n int, d time.Duration) *ProposalBatcher
func (*ProposalBatcher) Batch ¶
func (b *ProposalBatcher) Batch(m raftpb.Message)
func (*ProposalBatcher) IsEmpty ¶
func (b *ProposalBatcher) IsEmpty() bool
func (*ProposalBatcher) Reset ¶
func (b *ProposalBatcher) Reset(t time.Time)
type Transporter ¶
type Transporter interface { Handler() http.Handler Send(m []raftpb.Message) // AddRemote adds a remote with given peer urls into the transport. // A remote helps newly joined member to catch up the progress of cluster, // and will not be used after that. // It is the caller's responsibility to ensure the urls are all vaild, // or it panics. AddRemote(id types.ID, urls []string) AddPeer(id types.ID, urls []string) RemovePeer(id types.ID) RemoveAllPeers() UpdatePeer(id types.ID, urls []string) Stop() }
func NewTransporter ¶
func NewTransporter(rt http.RoundTripper, id, cid types.ID, r Raft, errorc chan error, ss *stats.ServerStats, ls *stats.LeaderStats) Transporter
Click to show internal directories.
Click to hide internal directories.