Documentation
¶
Overview ¶
Package transport implements the protocol stack responsible for exchanging data between Secure Scuttlebutt peers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { PerformRequest(ctx context.Context, req *rpc.Request) (rpc.ResponseStream, error) // WasInitiatedByRemote returns true if this is a connection that was // initiated by the remote peer. WasInitiatedByRemote() bool Close() error }
Connection represents an RPC connection to a peer.
type NewPeerHandler ¶
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer exists just for the purpose of keeping track of a connection together with the identity of the remote node.
In theory that identity could be kept at the connection level and returned by the Connection interface however at the protocol level the concept of a remote identity exists only during the handshake. According to the protocol the RPC connection itself doesn't really know about the handshake or the identity. Those are properties of the underlying boxstream transport layer.
func MustNewPeer ¶
func MustNewPeer(remote identity.Public, conn Connection) Peer
func (Peer) Conn ¶
func (p Peer) Conn() Connection
type PeerInitializer ¶
type PeerInitializer struct {
// contains filtered or unexported fields
}
func NewPeerInitializer ¶
func NewPeerInitializer( handshaker boxstream.Handshaker, requestHandler rpc.RequestHandler, connectionIdGenerator *rpc.ConnectionIdGenerator, newPeerHandler NewPeerHandler, logger logging.Logger, ) *PeerInitializer
func (PeerInitializer) InitializeClientPeer ¶
func (i PeerInitializer) InitializeClientPeer(ctx context.Context, rwc io.ReadWriteCloser, remote identity.Public) (Peer, error)
func (PeerInitializer) InitializeServerPeer ¶
func (i PeerInitializer) InitializeServerPeer(ctx context.Context, rwc io.ReadWriteCloser) (Peer, error)