Versions in this module Expand all Collapse all v3 v3.3.102 Mar 9, 2021 v3.3.101 Mar 3, 2021 Changes in this version + const TCPTransportName + 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 ErrUnknownTarget = errors.New("target address unknown") + var NOOPRaftName = "noop-test-transport" + func NewNOOPTransport(nhConfig config.NodeHostConfig, requestHandler raftio.MessageHandler, ...) raftio.ITransport + func NewTCPTransport(nhConfig config.NodeHostConfig, requestHandler raftio.MessageHandler, ...) raftio.ITransport + type Chunk struct + func NewChunk(onReceive func(pb.MessageBatch), confirm func(uint64, uint64, uint64), ...) *Chunk + func (c *Chunk) Add(chunk pb.Chunk) bool + func (c *Chunk) Close() + func (c *Chunk) Tick() + 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 DefaultTransportFactory struct + func (dtm *DefaultTransportFactory) Create(nhConfig config.NodeHostConfig, handler raftio.MessageHandler, ...) raftio.ITransport + func (dtm *DefaultTransportFactory) Validate(addr string) bool + type IMessageHandler 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 INodeRegistry interface + Add func(clusterID uint64, nodeID uint64, url string) + Remove func(clusterID uint64, nodeID uint64) + RemoveCluster func(clusterID uint64) + Resolve func(clusterID uint64, nodeID uint64) (string, string, error) + Stop func() + func NewNodeHostIDRegistry(nhid string, nhConfig config.NodeHostConfig, streamConnections uint64, ...) (INodeRegistry, error) + type IResolver interface + Add func(uint64, uint64, string) + Resolve func(uint64, uint64) (string, string, error) + type ITransport interface + GetStreamSink func(clusterID uint64, nodeID uint64) *Sink + Name func() string + Send func(pb.Message) bool + SendSnapshot func(pb.Message) bool + 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 NOOPTransportFactory struct + func (n *NOOPTransportFactory) Create(nhConfig config.NodeHostConfig, handler raftio.MessageHandler, ...) raftio.ITransport + func (n *NOOPTransportFactory) Validate(addr string) bool + type NodeHostIDRegistry struct + func (n *NodeHostIDRegistry) Add(clusterID uint64, nodeID uint64, target string) + func (n *NodeHostIDRegistry) AdvertiseAddress() string + func (n *NodeHostIDRegistry) NumMembers() int + func (n *NodeHostIDRegistry) Remove(clusterID uint64, nodeID uint64) + func (n *NodeHostIDRegistry) RemoveCluster(clusterID uint64) + func (n *NodeHostIDRegistry) Resolve(clusterID uint64, nodeID uint64) (string, string, error) + func (n *NodeHostIDRegistry) Stop() + type Registry struct + func NewNodeRegistry(streamConnections uint64, v config.TargetValidator) *Registry + func (n *Registry) Add(clusterID uint64, nodeID uint64, target string) + func (n *Registry) Remove(clusterID uint64, nodeID uint64) + func (n *Registry) RemoveCluster(clusterID uint64) + func (n *Registry) Resolve(clusterID uint64, nodeID uint64) (string, string, error) + func (n *Registry) Stop() + 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 TCP struct + func (t *TCP) GetConnection(ctx context.Context, target string) (raftio.IConnection, error) + func (t *TCP) GetSnapshotConnection(ctx context.Context, target string) (raftio.ISnapshotConnection, error) + func (t *TCP) Name() string + func (t *TCP) Start() error + func (t *TCP) Stop() + 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 Transport struct + func NewTransport(nhConfig config.NodeHostConfig, handler IMessageHandler, env *server.Env, ...) (*Transport, error) + func (t *Transport) GetCircuitBreaker(key string) *circuit.Breaker + func (t *Transport) GetStreamSink(clusterID uint64, nodeID uint64) *Sink + func (t *Transport) GetTrans() raftio.ITransport + func (t *Transport) Name() string + func (t *Transport) Send(req pb.Message) bool + func (t *Transport) SendSnapshot(m pb.Message) bool + func (t *Transport) SetPreSendBatchHook(h SendMessageBatchFunc) + func (t *Transport) SetPreStreamChunkSendHook(h StreamChunkSendFunc) + func (t *Transport) Stop() Other modules containing this package github.com/vyevenko/dragonboat