transport

package
v0.0.0-...-a582c34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClosed indicates that the connection has been closed.
	ErrClosed = errors.New("connection closed")
	// ErrFailedToConnect indicates that connecting to the remote failed.
	ErrFailedToConnect = errors.New("failed to connect")
)

Functions

func NewChanTransport

func NewChanTransport(nhConfig config.NodeHostConfig,
	requestHandler raftio.MessageHandler,
	chunkHandler raftio.ChunkHandler) raftio.ITransport

NewChanTransport creates a new channel based test transport module.

Types

type ChanConnection

type ChanConnection struct {
	// contains filtered or unexported fields
}

ChanConnection is a channel based connection.

func (*ChanConnection) Close

func (cc *ChanConnection) Close()

Close ...

func (*ChanConnection) SendMessageBatch

func (cc *ChanConnection) SendMessageBatch(batch pb.MessageBatch) error

SendMessageBatch ...

type ChanSSConnection

type ChanSSConnection struct {
	// contains filtered or unexported fields
}

ChanSSConnection is a channel based snapshot connection.

func (*ChanSSConnection) Close

func (csc *ChanSSConnection) Close()

Close ...

func (*ChanSSConnection) SendChunk

func (csc *ChanSSConnection) SendChunk(chunk pb.Chunk) error

SendChunk ...

type ChanTransport

type ChanTransport struct {
	// contains filtered or unexported fields
}

ChanTransport is a channel based transport module used for testing purposes.

func (*ChanTransport) Close

func (ct *ChanTransport) Close() error

Close ...

func (*ChanTransport) GetConnection

func (ct *ChanTransport) GetConnection(ctx context.Context,
	target string) (raftio.IConnection, error)

GetConnection ...

func (*ChanTransport) GetSnapshotConnection

func (ct *ChanTransport) GetSnapshotConnection(ctx context.Context,
	target string) (raftio.ISnapshotConnection, error)

GetSnapshotConnection ...

func (*ChanTransport) Name

func (ct *ChanTransport) Name() string

Name ...

func (*ChanTransport) Start

func (ct *ChanTransport) Start() error

Start ...

type ChanTransportFactory

type ChanTransportFactory struct{}

ChanTransportFactory is a channel based module used for testing purposes.

func (*ChanTransportFactory) Create

Create creates a channel based transport instance.

func (*ChanTransportFactory) Validate

func (ctm *ChanTransportFactory) Validate(addr string) bool

Validate returns a boolean value indicating whether the specified address is valid.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL