Documentation
¶
Index ¶
Constants ¶
View Source
const (
// TransportMTU is the guaranteed MTU presented to networks.
TransportMTU = (1 << 16) - 1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network interface {
p2p.Teller[inet256.Addr]
p2p.Secure[inet256.Addr]
LocalAddr() inet256.Addr
MTU(context.Context, inet256.Addr) int
FindAddr(ctx context.Context, prefix []byte, nbits int) (inet256.Addr, error)
Bootstrap(ctx context.Context) error
Close() error
}
Network is an instantiated network routing algorithm
This interface is not described in the spec, and is incidental to the implementation.
type Params ¶
type Params struct {
PrivateKey PrivateKey
Swarm Swarm
Peers PeerSet
Logger *Logger
}
Params are passed to a NetworkFactory to create a Network. This type really defines the problem domain quite well. Essentially it is a set of one-hop peers and a means to send messages to them.
type PrivateKey ¶
type PrivateKey = inet256.PrivateKey
type ReceiveFunc ¶
type ReceiveFunc = inet256.ReceiveFunc
type Swarm ¶
type Swarm interface {
p2p.Teller[inet256.Addr]
Close() error
LookupPublicKey(ctx context.Context, addr Addr) (PublicKey, error)
PublicKey() PublicKey
LocalAddr() Addr
MTU(ctx context.Context, addr Addr) int
}
Swarm is similar to a p2p.Swarm, but uses inet256.Addrs instead of p2p.Addrs
This interface is not described in the spec, and is incidental to the implementation.
Click to show internal directories.
Click to hide internal directories.