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 HandshakeFunc ¶
type Peer ¶
type Peer interface {
Close() error
}
Peer is an interface that represents the remote node.
type RPC ¶
Message represents any arbitrary data that is being sent over each transport between two nodes in the network.
type TCPTransportOpts ¶
type TCPTransportOpts struct {
ListenAddr string
HandshakeFunc HandshakeFunc
Decoder
OnPeer func(peer Peer) error
}
type Transport ¶
Transport is anything that handles the communication between the nodes in the network. This can be of the form (TCP, UDP, websockets, ...)
func NewTCPTransport ¶
func NewTCPTransport(opts TCPTransportOpts) Transport
Click to show internal directories.
Click to hide internal directories.