Documentation
¶
Overview ¶
Package quic is an experimental, incomplete implementation of the QUIC protocol. This package is a work in progress, and is not ready for use at this time.
This package implements (or will implement) RFC 9000, RFC 9001, and RFC 9002.
Index ¶
- type ApplicationError
- type Config
- type Conn
- type Stream
- func (s *Stream) IsReadOnly() bool
- func (s *Stream) IsWriteOnly() bool
- func (s *Stream) Read(b []byte) (n int, err error)
- func (s *Stream) ReadContext(ctx context.Context, b []byte) (n int, err error)
- func (s *Stream) Write(b []byte) (n int, err error)
- func (s *Stream) WriteContext(ctx context.Context, b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationError ¶
An ApplicationError is an application protocol error code (RFC 9000, Section 20.2). Application protocol errors may be sent when terminating a stream or connection.
func (ApplicationError) Error ¶
func (e ApplicationError) Error() string
type Config ¶
type Config struct { // TLSConfig is the endpoint's TLS configuration. // It must be non-nil and include at least one certificate or else set GetCertificate. TLSConfig *tls.Config }
A Config structure configures a QUIC endpoint. A Config must not be modified after it has been passed to a QUIC function. A Config may be reused; the quic package will also not modify it.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
A Conn is a QUIC connection.
Multiple goroutines may invoke methods on a Conn simultaneously.
func (*Conn) AcceptStream ¶ added in v0.14.0
AcceptStream waits for and returns the next stream created by the peer.
func (*Conn) NewSendOnlyStream ¶ added in v0.14.0
NewSendOnlyStream creates a unidirectional, send-only stream.
If the peer's maximum stream limit for the connection has been reached, NewSendOnlyStream blocks until the limit is increased or the context expires.
type Stream ¶ added in v0.14.0
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) IsReadOnly ¶ added in v0.14.0
IsReadOnly reports whether the stream is read-only (a unidirectional stream created by the peer).
func (*Stream) IsWriteOnly ¶ added in v0.14.0
IsWriteOnly reports whether the stream is write-only (a unidirectional stream created locally).
func (*Stream) Read ¶ added in v0.14.0
Read reads data from the stream. See ReadContext for more details.
func (*Stream) ReadContext ¶ added in v0.14.0
ReadContext reads data from the stream.
ReadContext returns as soon as at least one byte of data is available.
If the peer closes the stream cleanly, ReadContext returns io.EOF after returning all data sent by the peer. If the peer terminates reads abruptly, ReadContext returns StreamResetError.
func (*Stream) Write ¶ added in v0.14.0
Write writes data to the stream. See WriteContext for more details.
func (*Stream) WriteContext ¶ added in v0.14.0
WriteContext writes data to the stream.
WriteContext writes data to the stream write buffer. Buffered data is only sent when the buffer is sufficiently full. Call the Flush method to ensure buffered data is sent.
If the peer aborts reads on the stream, ReadContext returns StreamResetError.
Source Files
¶
- ack_delay.go
- acks.go
- config.go
- congestion_reno.go
- conn.go
- conn_id.go
- conn_loss.go
- conn_recv.go
- conn_send.go
- conn_streams.go
- crypto_stream.go
- dgram.go
- doc.go
- errors.go
- frame_debug.go
- gate.go
- log.go
- loss.go
- math.go
- pacer.go
- packet.go
- packet_number.go
- packet_parser.go
- packet_protection.go
- packet_writer.go
- ping.go
- pipe.go
- queue.go
- quic.go
- rangeset.go
- rtt.go
- sent_packet.go
- sent_packet_list.go
- sent_val.go
- stream.go
- tls.go
- transport_params.go
- wire.go