Documentation ¶
Overview ¶
Package wrapper is a wrapper around lucas-clemente/quic-go to match the net.Conn based interface used troughout pion/webrtc.
Index ¶
- type Config
- type Listener
- type ReadableStream
- type Session
- func (s *Session) AcceptStream() (*Stream, error)
- func (s *Session) AcceptUniStream() (*ReadableStream, error)
- func (s *Session) Close() error
- func (s *Session) CloseWithError(code uint16, err error) error
- func (s *Session) GetRemoteCertificates() []*x509.Certificate
- func (s *Session) OpenStream() (*Stream, error)
- func (s *Session) OpenUniStream() (*WritableStream, error)
- type Stream
- func (s *Stream) Close() error
- func (s *Stream) Detach() quic.Stream
- func (s *Stream) Read(p []byte) (int, error)
- func (s *Stream) ReadQuic(p []byte) (int, bool, error)
- func (s *Stream) SetDeadline(t time.Time) error
- func (s *Stream) StreamID() uint64
- func (s *Stream) Write(p []byte, fin bool) (int, error)
- func (s *Stream) WriteQuic(p []byte, fin bool) (int, error)
- type WritableStream
- func (s *WritableStream) Close() error
- func (s *WritableStream) Detach() quic.SendStream
- func (s *WritableStream) SetWriteDeadline(t time.Time) error
- func (s *WritableStream) StreamID() uint64
- func (s *WritableStream) Write(p []byte, fin bool) (int, error)
- func (s *WritableStream) WriteQuic(p []byte, fin bool) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Certificate *x509.Certificate PrivateKey crypto.PrivateKey SkipVerify bool }
Config represents the configuration of a Quic session
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
A Listener for incoming QUIC connections
type ReadableStream ¶
type ReadableStream struct {
// contains filtered or unexported fields
}
ReadableStream represents a wrapped quic-go ReceiveStream
func (*ReadableStream) Detach ¶
func (s *ReadableStream) Detach() quic.ReceiveStream
Detach returns the underlying quic-go ReveiveStream
func (*ReadableStream) Read ¶
func (s *ReadableStream) Read(p []byte) (int, error)
Read implements the Conn Read method.
func (*ReadableStream) ReadQuic ¶
func (s *ReadableStream) ReadQuic(p []byte) (int, bool, error)
ReadQuic reads a frame and determines if it is the final frame
func (*ReadableStream) SetReadDeadline ¶
func (s *ReadableStream) SetReadDeadline(t time.Time) error
SetReadDeadline sets the deadline for future Read calls. A zero value for t means Read will not time out.
func (*ReadableStream) StreamID ¶
func (s *ReadableStream) StreamID() uint64
StreamID returns the ID of the QuicStream
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
A Session is a QUIC connection between two peers.
func (*Session) AcceptStream ¶
AcceptStream accepts an incoming stream
func (*Session) AcceptUniStream ¶
func (s *Session) AcceptUniStream() (*ReadableStream, error)
AcceptUniStream accepts an incoming unidirectional stream and returns a ReadableStream
func (*Session) CloseWithError ¶
CloseWithError closes the connection with an error. The error must not be nil.
func (*Session) GetRemoteCertificates ¶
func (s *Session) GetRemoteCertificates() []*x509.Certificate
GetRemoteCertificates returns the certificate chain presented by remote peer.
func (*Session) OpenStream ¶
OpenStream opens a new stream
func (*Session) OpenUniStream ¶
func (s *Session) OpenUniStream() (*WritableStream, error)
OpenUniStream opens and returns a new WritableStream
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream represents a wrapped quic-go Stream
func (*Stream) Close ¶
Close implements the Conn Close method. It is used to close the connection. Any calls to Read and Write will be unblocked and return an error.
func (*Stream) SetDeadline ¶
SetDeadline sets read and write deadlines associated with the stream. A zero value for t means Read and Write will not timeout.
type WritableStream ¶
type WritableStream struct {
// contains filtered or unexported fields
}
WritableStream represents a wrapped quic-go SendStream
func (*WritableStream) Close ¶
func (s *WritableStream) Close() error
Close implements the Conn Close method. It is used to close the connection. Any calls to Write will be unblocked and return an error.
func (*WritableStream) Detach ¶
func (s *WritableStream) Detach() quic.SendStream
Detach returns the underlying quic-go SendStream
func (*WritableStream) SetWriteDeadline ¶
func (s *WritableStream) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the deadline for future Write calls. A zero value for t means Write will not time out.
func (*WritableStream) StreamID ¶
func (s *WritableStream) StreamID() uint64
StreamID returns the ID of the QuicStream