Documentation ¶
Index ¶
- type Conn
- func (c *Conn) AcceptStream() (smux.MuxedStream, error)
- func (c *Conn) Close() error
- func (c *Conn) IsClosed() bool
- func (c *Conn) LocalMultiaddr() ma.Multiaddr
- func (c *Conn) LocalPeer() peer.ID
- func (c *Conn) LocalPrivateKey() ic.PrivKey
- func (c *Conn) OpenStream(ctx context.Context) (smux.MuxedStream, error)
- func (c *Conn) RemoteMultiaddr() ma.Multiaddr
- func (c *Conn) RemotePeer() peer.ID
- func (c *Conn) RemotePublicKey() ic.PubKey
- func (c *Conn) Scope() smux.ConnScope
- func (c *Conn) Transport() tpt.Transport
- type Listener
- type Stream
- func (s *Stream) Close() error
- func (s *Stream) CloseRead() error
- func (s *Stream) CloseWrite() error
- func (s *Stream) Read(p []byte) (int, error)
- func (s *Stream) Reset() error
- func (s *Stream) SetDeadline(t time.Time) error
- func (s *Stream) SetReadDeadline(t time.Time) error
- func (s *Stream) SetWriteDeadline(t time.Time) error
- func (s *Stream) Write(p []byte) (int, error)
- type Transport
- func (t *Transport) CanDial(addr ma.Multiaddr) bool
- func (t *Transport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (tpt.CapableConn, error)
- func (t *Transport) Listen(laddr ma.Multiaddr) (tpt.Listener, error)
- func (t *Transport) Protocols() []int
- func (t *Transport) Proxy() bool
- func (t *Transport) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a stream-multiplexing connection to a remote peer.
func (*Conn) AcceptStream ¶
func (c *Conn) AcceptStream() (smux.MuxedStream, error)
AcceptStream accepts a stream opened by the other side.
func (*Conn) IsClosed ¶
IsClosed returns whether a connection is fully closed, so it can be garbage collected.
func (*Conn) LocalMultiaddr ¶
LocalMultiaddr returns the local Multiaddr associated with this connection
func (*Conn) LocalPrivateKey ¶
LocalPrivateKey returns our private key
func (*Conn) OpenStream ¶
OpenStream creates a new stream.
func (*Conn) RemoteMultiaddr ¶
RemoteMultiaddr returns the remote Multiaddr associated with this connection
func (*Conn) RemotePeer ¶
RemotePeer returns the peer ID of the remote peer.
func (*Conn) RemotePublicKey ¶
RemotePublicKey returns the public key of the remote peer.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is an interface closely resembling the net.Listener interface.
func (*Listener) Accept ¶
func (l *Listener) Accept() (tpt.CapableConn, error)
Accept waits for and returns the next connection to the listener.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream is a bidirectional io pipe within a connection.
func (*Stream) Close ¶
Close closes the stream for writing. Reading will still work (that is, the remote side can still write).
func (*Stream) CloseRead ¶
CloseRead closes the stream for writing. Reading will still work (that is, the remote side can still write).
func (*Stream) CloseWrite ¶
CloseWrite closes the stream for writing. Reading will still work (that is, the remote side can still write).
func (*Stream) Reset ¶
Reset closes both ends of the stream. Use this to tell the remote side to hang up and go away.
func (*Stream) SetReadDeadline ¶
SetReadDeadline is a stub
func (*Stream) SetWriteDeadline ¶
SetWriteDeadline is a stub
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is the WebRTC transport.
func NewTransport ¶
func NewTransport(webrtcOptions webrtc.Configuration, muxer smux.Multiplexer, rcmgr smux.ResourceManager) *Transport
NewTransport creates a WebRTC transport that signals over a direct HTTP connection. It is currently required to provide a muxer.
func (*Transport) CanDial ¶
CanDial returns true if this transport believes it can dial the given multiaddr.
func (*Transport) Dial ¶
func (t *Transport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (tpt.CapableConn, error)
Dial dials the peer at the remote address.
func (*Transport) Protocols ¶
Protocols returns the list of terminal protocols this transport can dial.