package rafthttp
import "github.com/coreos/etcd/rafthttp"
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, fs *stats.FollowerStats, errorc chan error) *peer
- func NewStreamHandler(tr *transport, id, cid types.ID) http.Handler
- type Batcher
- func NewBatcher(n int, d time.Duration) *Batcher
- func (b *Batcher) Reset(t time.Time)
- func (b *Batcher) ShouldBatch(now time.Time) bool
- type Pausable
- type ProposalBatcher
- func NewProposalBatcher(n int, d time.Duration) *ProposalBatcher
- func (b *ProposalBatcher) Batch(m raftpb.Message)
- func (b *ProposalBatcher) IsEmpty() bool
- func (b *ProposalBatcher) Reset(t time.Time)
- type Raft
- type Transporter
- type WriteFlusher
Constants ¶
const (
ConnReadLimitByte = 64 * 1024
)
Variables ¶
Functions ¶
func NewHandler ¶
func NewPeer ¶
func NewPeer(tr http.RoundTripper, u string, id types.ID, cid types.ID, r Raft, fs *stats.FollowerStats, errorc chan error) *peer
func NewStreamHandler ¶
NewStreamHandler returns a handler which initiates streamer when receiving stream request from follower.
Types ¶
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
func NewBatcher ¶
func (*Batcher) Reset ¶
func (*Batcher) ShouldBatch ¶
type Pausable ¶
type Pausable interface { Pause() Resume() }
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 Raft ¶
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
type WriteFlusher ¶
Source Files ¶
batcher.go entry_reader.go entry_writer.go http.go peer.go remote.go streamer.go transport.go
- Version
- v2.0.11+incompatible
- Published
- May 15, 2015
- Platform
- js/wasm
- Imports
- 22 packages
- Last checked
- 4 minutes ago –
Tools for package owners.