Documentation ¶
Index ¶
- func NewStream(s network.Stream) p2p.Stream
- type Options
- type Service
- func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
- func (s *Service) Addresses() (addreses []ma.Multiaddr, err error)
- func (s *Service) ApplyRoute(self boson.Address, rt routetab.RelayStream, mode aurora.Model)
- func (s *Service) Blocklist(overlay boson.Address, duration time.Duration, reason string) error
- func (s *Service) BlocklistRemove(overlay boson.Address) error
- func (s *Service) BlocklistedPeers() ([]p2p.BlockPeers, error)
- func (s *Service) CallHandler(ctx context.Context, last p2p.Peer, stream p2p.Stream) (relayData *pb.RouteRelayReq, w *p2p.WriterChan, r *p2p.ReaderChan, ...)
- func (s *Service) Close() error
- func (s *Service) Connect(ctx context.Context, addr ma.Multiaddr) (peer *p2p.Peer, err error)
- func (s *Service) Disconnect(overlay boson.Address, reason string) error
- func (s *Service) GetWelcomeMessage() string
- func (s *Service) Halt()
- func (s *Service) Metrics() []prometheus.Collector
- func (s *Service) NATAddresses() (addresses []net.Addr, err error)
- func (s *Service) NATManager() basichost.NATManager
- func (s *Service) NetworkStatus() p2p.NetworkStatus
- func (s *Service) NewRelayStream(ctx context.Context, target boson.Address, headers p2p.Headers, ...) (p2p.Stream, error)
- func (s *Service) NewStream(ctx context.Context, overlay boson.Address, headers p2p.Headers, ...) (p2p.Stream, error)
- func (s *Service) PeerID(overlay boson.Address) (id libp2ppeer.ID, found bool)
- func (s *Service) Peers() []p2p.Peer
- func (s *Service) Ping(ctx context.Context, addr ma.Multiaddr) (rtt time.Duration, err error)
- func (s *Service) Ready() error
- func (s *Service) ResourceManager() network.ResourceManager
- func (s *Service) SetPickyNotifier(n p2p.PickyNotifier)
- func (s *Service) SetWelcomeMessage(val string) error
- type UpnpAddressResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AddProtocol ¶
func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
func (*Service) ApplyRoute ¶ added in v1.2.0
func (*Service) BlocklistRemove ¶ added in v1.3.2
func (*Service) BlocklistedPeers ¶
func (s *Service) BlocklistedPeers() ([]p2p.BlockPeers, error)
func (*Service) CallHandler ¶ added in v1.2.0
func (s *Service) CallHandler(ctx context.Context, last p2p.Peer, stream p2p.Stream) (relayData *pb.RouteRelayReq, w *p2p.WriterChan, r *p2p.ReaderChan, forward bool, err error)
func (*Service) Disconnect ¶
func (*Service) GetWelcomeMessage ¶
GetWelcomeMessage returns the value of the welcome message.
func (*Service) Metrics ¶
func (s *Service) Metrics() []prometheus.Collector
func (*Service) NATAddresses ¶ added in v1.1.6
func (*Service) NATManager ¶
func (s *Service) NATManager() basichost.NATManager
func (*Service) NetworkStatus ¶ added in v1.3.4
func (s *Service) NetworkStatus() p2p.NetworkStatus
NetworkStatus implements the p2p.NetworkStatus interface.
func (*Service) NewRelayStream ¶ added in v1.2.0
func (*Service) ResourceManager ¶ added in v1.3.3
func (s *Service) ResourceManager() network.ResourceManager
func (*Service) SetPickyNotifier ¶
func (s *Service) SetPickyNotifier(n p2p.PickyNotifier)
func (*Service) SetWelcomeMessage ¶
SetWelcomeMessage sets the welcome message for the handshake protocol.
type UpnpAddressResolver ¶
type UpnpAddressResolver struct {
// contains filtered or unexported fields
}
func (*UpnpAddressResolver) Resolve ¶
Resolve checks if there is a possible better advertisable underlay then the provided observed address. In some NAT situations, for example in the case when nodes are behind upnp, observer might send the observed address with a wrong port. In this case, observed address is compared to addresses provided by host, and if there is a same address but with different port, that one is used as advertisable address instead of provided observed one. TODO: this is a quickfix and it will be improved in the future
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
handshake/pb
Package pb holds only Protocol Buffer definitions and generated code.
|
Package pb holds only Protocol Buffer definitions and generated code. |
headers/pb
Package pb holds only Protocol Buffer definitions and generated code.
|
Package pb holds only Protocol Buffer definitions and generated code. |
reacher
Package reacher runs a background worker that will ping peers from an internal queue and report back the reachability to the notifier.
|
Package reacher runs a background worker that will ping peers from an internal queue and report back the reachability to the notifier. |