Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entanglement ¶
type Entanglement[THash comparable] struct { // contains filtered or unexported fields }
Entanglement broadcasts messages between peers.
func New ¶
func New[THash comparable]( peerCh <-chan PeerIO, sendCh <-chan []byte, hashingFunc HashingFunc[THash], msgHandler HandlerFunc[THash], ) *Entanglement[THash]
New creates new entanglement.
func (*Entanglement[THash]) ClearCache ¶
func (e *Entanglement[THash]) ClearCache(hash THash)
ClearCache removes hash from the deduplication cache.
type HandlerFunc ¶ added in v0.2.0
type HandlerFunc[THash comparable] func(ctx context.Context, msg []byte, hash THash) error
HandlerFunc defines the function handling received messages.
type HashingFunc ¶ added in v0.2.0
type HashingFunc[THash comparable] func(msg []byte) THash
HashingFunc computes hash of the message.