Versions in this module Expand all Collapse all v3 v3.2.5 May 10, 2020 v3.2.4 May 10, 2020 Changes in this version + const TCPRaftRPCName + const UnmanagedDeploymentID + var ErrBadMessage = errors.New("invalid message") + var ErrRequestedToFail = errors.New("requested to returned error") + var ErrSnapshotOutOfDate = errors.New("snapshot is out of date") + var ErrStopped = errors.New("connection stopped") + var ErrStreamSnapshot = errors.New("stream snapshot failed") + var NOOPRaftName = "noop-test-transport" + func NewNOOPTransport(nhConfig config.NodeHostConfig, requestHandler raftio.RequestHandler, ...) raftio.IRaftRPC + func NewTCPTransport(nhConfig config.NodeHostConfig, requestHandler raftio.RequestHandler, ...) raftio.IRaftRPC + type ChunkFile struct + func CreateChunkFile(fp string, fs vfs.IFS) (*ChunkFile, error) + func OpenChunkFileForAppend(fp string, fs vfs.IFS) (*ChunkFile, error) + func OpenChunkFileForRead(fp string, fs vfs.IFS) (*ChunkFile, error) + func (cf *ChunkFile) Close() error + func (cf *ChunkFile) Read(data []byte) (int, error) + func (cf *ChunkFile) ReadAt(data []byte, offset int64) (int, error) + func (cf *ChunkFile) Sync() error + func (cf *ChunkFile) Write(data []byte) (int, error) + type Chunks struct + func NewChunks(onReceive func(pb.MessageBatch), confirm func(uint64, uint64, uint64), ...) *Chunks + func (c *Chunks) AddChunk(chunk pb.Chunk) bool + func (c *Chunks) Close() + func (c *Chunks) Tick() + type DeploymentID struct + func (d *DeploymentID) SetDeploymentID(x uint64) + func (d *DeploymentID) SetUnmanagedDeploymentID() + type INodeAddressResolver interface + AddRemoteAddress func(uint64, uint64, string) + Resolve func(uint64, uint64) (string, string, error) + ReverseResolve func(string) []raftio.NodeInfo + type INodeRegistry interface + AddNode func(clusterID uint64, nodeID uint64, url string) + RemoveCluster func(clusterID uint64) + RemoveNode func(clusterID uint64, nodeID uint64) + Resolve func(clusterID uint64, nodeID uint64) (string, string, error) + type IRaftMessageHandler interface + HandleMessageBatch func(batch pb.MessageBatch) (uint64, uint64) + HandleSnapshot func(clusterID uint64, nodeID uint64, from uint64) + HandleSnapshotStatus func(clusterID uint64, nodeID uint64, rejected bool) + HandleUnreachable func(clusterID uint64, nodeID uint64) + type ITransport interface + ASyncSend func(pb.Message) bool + ASyncSendSnapshot func(pb.Message) bool + GetStreamConnection func(clusterID uint64, nodeID uint64) *Sink + Name func() string + SetDeploymentID func(uint64) + SetMessageHandler func(IRaftMessageHandler) + SetUnmanagedDeploymentID func() + Stop func() + type ITransportEvent interface + ConnectionEstablished func(string, bool) + ConnectionFailed func(string, bool) + type Marshaler interface + MarshalTo func([]byte) (int, error) + Size func() int + type NOOPConnection struct + func (c *NOOPConnection) Close() + func (c *NOOPConnection) SendMessageBatch(batch raftpb.MessageBatch) error + type NOOPSnapshotConnection struct + func (c *NOOPSnapshotConnection) Close() + func (c *NOOPSnapshotConnection) SendChunk(chunk raftpb.Chunk) error + type NOOPTransport struct + func (g *NOOPTransport) GetConnection(ctx context.Context, target string) (raftio.IConnection, error) + func (g *NOOPTransport) GetSnapshotConnection(ctx context.Context, target string) (raftio.ISnapshotConnection, error) + func (g *NOOPTransport) Name() string + func (g *NOOPTransport) Start() error + func (g *NOOPTransport) Stop() + type Nodes struct + func NewNodes(streamConnections uint64) *Nodes + func (n *Nodes) AddNode(clusterID uint64, nodeID uint64, url string) + func (n *Nodes) AddRemoteAddress(clusterID uint64, nodeID uint64, address string) + func (n *Nodes) RemoveAllPeers() + func (n *Nodes) RemoveCluster(clusterID uint64) + func (n *Nodes) RemoveNode(clusterID uint64, nodeID uint64) + func (n *Nodes) Resolve(clusterID uint64, nodeID uint64) (string, string, error) + func (n *Nodes) ReverseResolve(addr string) []raftio.NodeInfo + type SendMessageBatchFunc func(pb.MessageBatch) (pb.MessageBatch, bool) + type Sink struct + func (s *Sink) ClusterID() uint64 + func (s *Sink) Receive(chunk pb.Chunk) (bool, bool) + func (s *Sink) Stop() + func (s *Sink) ToNodeID() uint64 + type StreamChunkSendFunc func(pb.Chunk) (pb.Chunk, bool) + type TCPConnection struct + func NewTCPConnection(conn net.Conn, rb *ratelimit.Bucket, wb *ratelimit.Bucket, encrypted bool) *TCPConnection + func (c *TCPConnection) Close() + func (c *TCPConnection) SendMessageBatch(batch pb.MessageBatch) error + type TCPSnapshotConnection struct + func NewTCPSnapshotConnection(conn net.Conn, rb *ratelimit.Bucket, wb *ratelimit.Bucket, encrypted bool) *TCPSnapshotConnection + func (c *TCPSnapshotConnection) Close() + func (c *TCPSnapshotConnection) SendChunk(chunk pb.Chunk) error + type TCPTransport struct + func (g *TCPTransport) GetConnection(ctx context.Context, target string) (raftio.IConnection, error) + func (g *TCPTransport) GetSnapshotConnection(ctx context.Context, target string) (raftio.ISnapshotConnection, error) + func (g *TCPTransport) Name() string + func (g *TCPTransport) Start() error + func (g *TCPTransport) Stop() + type Transport struct + func NewTransport(nhConfig config.NodeHostConfig, ctx *server.Context, ...) (*Transport, error) + func (t *Transport) ASyncSend(req pb.Message) bool + func (t *Transport) ASyncSendSnapshot(m pb.Message) bool + func (t *Transport) GetCircuitBreaker(key string) *circuit.Breaker + func (t *Transport) GetRaftRPC() raftio.IRaftRPC + func (t *Transport) GetStreamConnection(clusterID uint64, nodeID uint64) *Sink + func (t *Transport) Name() string + func (t *Transport) SetMessageHandler(handler IRaftMessageHandler) + func (t *Transport) SetPreSendMessageBatchHook(h SendMessageBatchFunc) + func (t *Transport) SetPreStreamChunkSendHook(h StreamChunkSendFunc) + func (t *Transport) Stop() Other modules containing this package github.com/mkawserm/dragonboat