Documentation ¶
Overview ¶
Package quic implements the QUIC API for Client-to-Server Connections https://w3c.github.io/webrtc-quic/
Index ¶
- type BidirectionalStream
- type Config
- type StreamReadResult
- type StreamWriteParameters
- type Transport
- type TransportBase
- func (b *TransportBase) CreateBidirectionalStream() (*BidirectionalStream, error)
- func (b *TransportBase) GetRemoteCertificates() []*x509.Certificate
- func (b *TransportBase) OnBidirectionalStream(f func(*BidirectionalStream))
- func (b *TransportBase) StartBase(conn net.Conn, config *Config) error
- func (b *TransportBase) Stop(stopInfo TransportStopInfo) error
- type TransportStopInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BidirectionalStream ¶
type BidirectionalStream struct {
// contains filtered or unexported fields
}
BidirectionalStream represents a bidirectional Quic stream.
func (*BidirectionalStream) Detach ¶
func (s *BidirectionalStream) Detach() quic.Stream
Detach detaches the underlying quic-go stream
func (*BidirectionalStream) ReadInto ¶
func (s *BidirectionalStream) ReadInto(data []byte) (StreamReadResult, error)
ReadInto reads from the QuicReadableStream into the buffer.
func (*BidirectionalStream) StreamID ¶
func (s *BidirectionalStream) StreamID() uint64
StreamID returns the ID of the QuicStream
func (*BidirectionalStream) Write ¶
func (s *BidirectionalStream) Write(data StreamWriteParameters) error
Write writes data to the stream.
type Config ¶
type Config struct { Client bool Certificate *x509.Certificate PrivateKey crypto.PrivateKey LoggerFactory logging.LoggerFactory }
Config is used to hold the configuration of StartBase
type StreamReadResult ¶
StreamReadResult holds information relating to the result returned from readInto.
type StreamWriteParameters ¶
StreamWriteParameters holds information relating to the data to be written.
type Transport ¶
type Transport struct {
TransportBase
}
Transport is a quic transport focused on client/server use cases.
type TransportBase ¶
type TransportBase struct {
// contains filtered or unexported fields
}
TransportBase is the base for Transport. Most of the functionality of a Transport is in the base class to allow for other subclasses (such as a p2p variant) to share the same interface.
func (*TransportBase) CreateBidirectionalStream ¶
func (b *TransportBase) CreateBidirectionalStream() (*BidirectionalStream, error)
CreateBidirectionalStream creates an QuicBidirectionalStream object.
func (*TransportBase) GetRemoteCertificates ¶
func (b *TransportBase) GetRemoteCertificates() []*x509.Certificate
GetRemoteCertificates returns the certificate chain in use by the remote side
func (*TransportBase) OnBidirectionalStream ¶
func (b *TransportBase) OnBidirectionalStream(f func(*BidirectionalStream))
OnBidirectionalStream allows setting an event handler for that is fired when data is received from a BidirectionalStream for the first time.
func (*TransportBase) StartBase ¶
func (b *TransportBase) StartBase(conn net.Conn, config *Config) error
StartBase is used to start the TransportBase. Most implementations should instead use the methods on quic.Transport or webrtc.QUICTransport to setup a Quic connection.
func (*TransportBase) Stop ¶
func (b *TransportBase) Stop(stopInfo TransportStopInfo) error
Stop stops and closes the TransportBase.
type TransportStopInfo ¶
TransportStopInfo holds information relating to the error code for stopping a TransportBase.