ceremonyclient/node/p2p/onion/transport.go
Cassandra Heart dbd95bd9e9
v2.1.0 (#439)
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete

* 2.1.0 main node rollup
2025-09-30 02:48:15 -05:00

15 lines
520 B
Go

package onion
import "context"
// Transport is the hop-to-hop link. It must already provide integrity/
// confidentiality. We route onion cells on top of it.
type Transport interface {
// Send a link-level cell to a peer.
Send(ctx context.Context, peerID []byte, circID uint32, cell []byte) error
// Register a callback for _incoming_ link-level cells from any peer.
// P2P layers should invoke cb for every onion payload destined to this node.
OnReceive(cb func(srcPeerID []byte, circID uint32, cell []byte))
}