Documentation ¶
Index ¶
- func IsErrGaterDisallowedConnection(err error) bool
- func IsErrProtocolNotSupported(err error) bool
- func IsErrSecurityProtocolNegotiationFailed(err error) bool
- type ErrGaterDisallowedConnection
- type ErrProtocolNotSupported
- type ErrSecurityProtocolNegotiationFailed
- type Factory
- type LibP2PStreamFactory
- func (l *LibP2PStreamFactory) ClearBackoff(p peer.ID)
- func (l *LibP2PStreamFactory) Connect(ctx context.Context, peerAddrInfo peer.AddrInfo) error
- func (l *LibP2PStreamFactory) DialAddress(p peer.ID) []multiaddr.Multiaddr
- func (l *LibP2PStreamFactory) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)
- func (l *LibP2PStreamFactory) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrGaterDisallowedConnection ¶
IsErrGaterDisallowedConnection returns whether an error is ErrGaterDisallowedConnection.
func IsErrProtocolNotSupported ¶
IsErrProtocolNotSupported returns whether an error is ErrProtocolNotSupported.
func IsErrSecurityProtocolNegotiationFailed ¶
IsErrSecurityProtocolNegotiationFailed returns whether an error is ErrSecurityProtocolNegotiationFailed.
Types ¶
type ErrGaterDisallowedConnection ¶
type ErrGaterDisallowedConnection struct {
// contains filtered or unexported fields
}
ErrGaterDisallowedConnection wrapper around github.com/libp2p/go-libp2p/p2p/net/swarm.ErrGaterDisallowedConnection.
func NewGaterDisallowedConnectionErr ¶
func NewGaterDisallowedConnectionErr(err error) ErrGaterDisallowedConnection
NewGaterDisallowedConnectionErr returns a new ErrGaterDisallowedConnection.
func (ErrGaterDisallowedConnection) Error ¶
func (e ErrGaterDisallowedConnection) Error() string
type ErrProtocolNotSupported ¶
type ErrProtocolNotSupported struct {
// contains filtered or unexported fields
}
ErrProtocolNotSupported indicates node is running on a different spork.
func NewProtocolNotSupportedErr ¶
func NewProtocolNotSupportedErr(peerID peer.ID, protocolIDS []protocol.ID, err error) ErrProtocolNotSupported
NewProtocolNotSupportedErr returns a new ErrSecurityProtocolNegotiationFailed.
func (ErrProtocolNotSupported) Error ¶
func (e ErrProtocolNotSupported) Error() string
type ErrSecurityProtocolNegotiationFailed ¶
type ErrSecurityProtocolNegotiationFailed struct {
// contains filtered or unexported fields
}
ErrSecurityProtocolNegotiationFailed indicates security protocol negotiation failed during the stream factory connect attempt.
func NewSecurityProtocolNegotiationErr ¶
func NewSecurityProtocolNegotiationErr(pid peer.ID, err error) ErrSecurityProtocolNegotiationFailed
NewSecurityProtocolNegotiationErr returns a new ErrSecurityProtocolNegotiationFailed.
func (ErrSecurityProtocolNegotiationFailed) Error ¶
func (e ErrSecurityProtocolNegotiationFailed) Error() string
type Factory ¶
type Factory interface { SetStreamHandler(protocol.ID, network.StreamHandler) DialAddress(peer.ID) []multiaddr.Multiaddr ClearBackoff(peer.ID) // Connect connects host to peer with peerID. // Expected errors during normal operations: // - NewSecurityProtocolNegotiationErr this indicates there was an issue upgrading the connection. Connect(context.Context, peer.AddrInfo) error // NewStream creates a new stream on the libp2p host. // Expected errors during normal operations: // - ErrProtocolNotSupported this indicates remote node is running on a different spork. NewStream(context.Context, peer.ID, ...protocol.ID) (network.Stream, error) }
Factory is a wrapper around libp2p host.Host to provide abstraction and encapsulation for unicast stream manager so that it can create libp2p streams with finer granularity.
func NewLibP2PStreamFactory ¶
type LibP2PStreamFactory ¶
type LibP2PStreamFactory struct {
// contains filtered or unexported fields
}
func (*LibP2PStreamFactory) ClearBackoff ¶
func (l *LibP2PStreamFactory) ClearBackoff(p peer.ID)
func (*LibP2PStreamFactory) Connect ¶
Connect connects host to peer with peerAddrInfo. Expected errors during normal operations:
- ErrSecurityProtocolNegotiationFailed this indicates there was an issue upgrading the connection.
func (*LibP2PStreamFactory) DialAddress ¶
func (l *LibP2PStreamFactory) DialAddress(p peer.ID) []multiaddr.Multiaddr
func (*LibP2PStreamFactory) NewStream ¶
func (l *LibP2PStreamFactory) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)
NewStream creates a new stream on the libp2p host. Expected errors during normal operations:
- ErrProtocolNotSupported this indicates remote node is running on a different spork.
func (*LibP2PStreamFactory) SetStreamHandler ¶
func (l *LibP2PStreamFactory) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)