Documentation
¶
Overview ¶
Package network provides utilities for coordinating multi-party protocols: session identifiers, message routing, and simple exchange patterns. The package is transport-agnostic; callers provide a Delivery implementation.
See README.md for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidArgument = errs.New("invalid argument") ErrFailed = errs.New("failed") )
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery interface {
PartyID() sharing.ID
Quorum() []sharing.ID
Send(to sharing.ID, message []byte) error
Receive() (from sharing.ID, message []byte, err error)
}
Delivery abstracts a transport layer used by the router.
type OutgoingUnicasts ¶
OutgoingUnicasts maps recipients to outbound unicast payloads.
type RoundMessages ¶
RoundMessages maps sender IDs to their round messages.
func ExchangeUnicastSimple ¶
func ExchangeUnicastSimple[U any](rt *Router, correlationID string, messages RoundMessages[U]) (RoundMessages[U], error)
ExchangeUnicastSimple sends messages to all participants and receives the same messages back from them.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router orchestrates correlation-aware sending and receiving over a Delivery.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package echo provides three-round echo broadcast primitive that ensures all honest parties deliver the same payload.
|
Package echo provides three-round echo broadcast primitive that ensures all honest parties deliver the same payload. |
|
Package exchange provides convenience functions that orchestrate broadcast and unicast communication patterns over a network.Router using correlation IDs and CBOR encoding.
|
Package exchange provides convenience functions that orchestrate broadcast and unicast communication patterns over a network.Router using correlation IDs and CBOR encoding. |
|
Package ntu provides helpers for exercising network protocols in-memory without real transports.
|
Package ntu provides helpers for exercising network protocols in-memory without real transports. |
Click to show internal directories.
Click to hide internal directories.