Documentation
¶
Index ¶
- Constants
- Variables
- func AddRelayTransport(ctx context.Context, h host.Host, opts ...RelayOpt) error
- type Conn
- func (c *Conn) ID() string
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) LocalMultiaddr() ma.Multiaddr
- func (c *Conn) LocalPeer() peer.ID
- func (c *Conn) LocalPrivateKey() ic.PrivKey
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) RemoteMultiaddr() ma.Multiaddr
- func (c *Conn) RemotePeer() peer.ID
- func (c *Conn) RemotePublicKey() ic.PubKey
- func (c *Conn) Transport() tpt.Transport
- type NetAddr
- type Relay
- func (r *Relay) CanHop(ctx context.Context, id peer.ID) (bool, error)
- func (r *Relay) DialPeer(ctx context.Context, relay pstore.PeerInfo, dest pstore.PeerInfo) (*Conn, error)
- func (r *Relay) Dialer() *RelayDialer
- func (r *Relay) Listener() *RelayListener
- func (r *Relay) Notifiee() inet.Notifiee
- func (r *Relay) Transport() *RelayTransport
- type RelayDialer
- type RelayError
- type RelayListener
- func (l *RelayListener) Accept() (tpt.Conn, error)
- func (l *RelayListener) Addr() net.Addr
- func (l *RelayListener) Close() error
- func (l *RelayListener) LocalPeer() peer.ID
- func (l *RelayListener) Multiaddr() ma.Multiaddr
- func (l *RelayListener) Relay() *Relay
- func (l *RelayListener) SetAddrFilters(f *filter.Filters)
- type RelayNotifiee
- func (n *RelayNotifiee) ClosedStream(net inet.Network, s inet.Stream)
- func (n *RelayNotifiee) Connected(s inet.Network, c inet.Conn)
- func (n *RelayNotifiee) Disconnected(s inet.Network, c inet.Conn)
- func (n *RelayNotifiee) Listen(net inet.Network, a ma.Multiaddr)
- func (n *RelayNotifiee) ListenClose(net inet.Network, a ma.Multiaddr)
- func (n *RelayNotifiee) OpenedStream(net inet.Network, s inet.Stream)
- func (n *RelayNotifiee) Relay() *Relay
- type RelayOpt
- type RelayTransport
Constants ¶
View Source
const P_CIRCUIT = 290
View Source
const ProtoID = "/libp2p/circuit/relay/0.1.0"
Variables ¶
View Source
var ( OptActive = RelayOpt(0) OptHop = RelayOpt(1) )
View Source
var HopConnectTimeout = 10 * time.Second
View Source
var Protocol = ma.Protocol{ Code: P_CIRCUIT, Size: 0, Name: "p2p-circuit", VCode: ma.CodeToVarint(P_CIRCUIT), }
View Source
var RelayAcceptTimeout = time.Minute
Functions ¶
Types ¶
type Conn ¶
func (*Conn) LocalMultiaddr ¶
func (*Conn) LocalPrivateKey ¶
func (*Conn) RemoteAddr ¶
func (*Conn) RemoteMultiaddr ¶
func (*Conn) RemotePeer ¶
func (*Conn) RemotePublicKey ¶
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
func (*Relay) Dialer ¶
func (r *Relay) Dialer() *RelayDialer
func (*Relay) Listener ¶
func (r *Relay) Listener() *RelayListener
func (*Relay) Transport ¶
func (r *Relay) Transport() *RelayTransport
type RelayDialer ¶
type RelayDialer Relay
func (*RelayDialer) DialContext ¶
func (*RelayDialer) Relay ¶
func (d *RelayDialer) Relay() *Relay
type RelayError ¶
type RelayError struct {
Code pb.CircuitRelay_Status
}
func (RelayError) Error ¶
func (e RelayError) Error() string
type RelayListener ¶
type RelayListener Relay
func (*RelayListener) Addr ¶
func (l *RelayListener) Addr() net.Addr
func (*RelayListener) Close ¶
func (l *RelayListener) Close() error
func (*RelayListener) LocalPeer ¶
func (l *RelayListener) LocalPeer() peer.ID
func (*RelayListener) Multiaddr ¶
func (l *RelayListener) Multiaddr() ma.Multiaddr
func (*RelayListener) Relay ¶
func (l *RelayListener) Relay() *Relay
func (*RelayListener) SetAddrFilters ¶
func (l *RelayListener) SetAddrFilters(f *filter.Filters)
type RelayNotifiee ¶ added in v1.1.0
type RelayNotifiee Relay
func (*RelayNotifiee) ClosedStream ¶ added in v1.1.0
func (n *RelayNotifiee) ClosedStream(net inet.Network, s inet.Stream)
func (*RelayNotifiee) Connected ¶ added in v1.1.0
func (n *RelayNotifiee) Connected(s inet.Network, c inet.Conn)
func (*RelayNotifiee) Disconnected ¶ added in v1.1.0
func (n *RelayNotifiee) Disconnected(s inet.Network, c inet.Conn)
func (*RelayNotifiee) Listen ¶ added in v1.1.0
func (n *RelayNotifiee) Listen(net inet.Network, a ma.Multiaddr)
func (*RelayNotifiee) ListenClose ¶ added in v1.1.0
func (n *RelayNotifiee) ListenClose(net inet.Network, a ma.Multiaddr)
func (*RelayNotifiee) OpenedStream ¶ added in v1.1.0
func (n *RelayNotifiee) OpenedStream(net inet.Network, s inet.Stream)
func (*RelayNotifiee) Relay ¶ added in v1.1.0
func (n *RelayNotifiee) Relay() *Relay
Source Files
¶
Click to show internal directories.
Click to hide internal directories.