Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NOPHandshakeFunc ¶
Types ¶
type DefaultDecoder ¶
type DefaultDecoder struct{}
type GOBDecoder ¶
type GOBDecoder struct{}
type Peer ¶
type Peer interface {
Close() error
}
Peer is an interface that represents the remote node
type RPC ¶
RPC holds any arbitrary data that is being sent over the each transport between two nodes in the network
type TCPPeer ¶
type TCPPeer struct {
// contains filtered or unexported fields
}
TCPPeer represents the remote node over a TCP established connection
type TCPTransport ¶
type TCPTransport struct { TCPTransportOpts // contains filtered or unexported fields }
func NewTCPTransport ¶
func NewTCPTransport(opts TCPTransportOpts) *TCPTransport
func (*TCPTransport) Consume ¶
func (t *TCPTransport) Consume() <-chan RPC
Consume implements the Transport interface, which will return read only channel for reading the incoming messages received from another peer in the network
func (*TCPTransport) ListenAndAccept ¶
func (t *TCPTransport) ListenAndAccept() error
type TCPTransportOpts ¶
type TCPTransportOpts struct { ListenAddr string HandshakeFunc HandshakeFunc Decoder Decoder OnPeer func(Peer) error }
Click to show internal directories.
Click to hide internal directories.