Documentation
¶
Overview ¶
Package http3 adapts iroh connections for HTTP/3 implementations.
The package does not implement HTTP/3. It provides a small QUIC-like surface over iroh.Conn so higher-level packages can build HTTP/3 over go-iroh without importing internal transport packages or adding another QUIC stack.
Index ¶
- type BidiStream
- func (s *BidiStream) CancelRead(code uint64)
- func (s *BidiStream) CancelWrite(code uint64)
- func (s *BidiStream) Close() error
- func (s *BidiStream) Context() context.Context
- func (s *BidiStream) IrohStream() *iroh.Stream
- func (s *BidiStream) Read(p []byte) (int, error)
- func (s *BidiStream) SetDeadline(t time.Time) error
- func (s *BidiStream) SetReadDeadline(t time.Time) error
- func (s *BidiStream) SetWriteDeadline(t time.Time) error
- func (s *BidiStream) Write(p []byte) (int, error)
- type Conn
- func (c *Conn) AcceptBidi(ctx context.Context) (*BidiStream, error)
- func (c *Conn) AcceptUni(ctx context.Context) (*ReceiveStream, error)
- func (c *Conn) Close(code uint64, reason string) error
- func (c *Conn) IrohConn() *iroh.Conn
- func (c *Conn) OpenBidi(ctx context.Context) (*BidiStream, error)
- func (c *Conn) OpenUni(ctx context.Context) (*SendStream, error)
- func (c *Conn) ReceiveDatagram(ctx context.Context) ([]byte, error)
- func (c *Conn) SendDatagram(b []byte) error
- type ReceiveStream
- type SendStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BidiStream ¶
type BidiStream struct {
// contains filtered or unexported fields
}
BidiStream is an HTTP/3 bidirectional stream.
func (*BidiStream) CancelRead ¶
func (s *BidiStream) CancelRead(code uint64)
CancelRead aborts receiving on s with code.
func (*BidiStream) CancelWrite ¶
func (s *BidiStream) CancelWrite(code uint64)
CancelWrite aborts sending on s with code.
func (*BidiStream) Context ¶
func (s *BidiStream) Context() context.Context
Context is cancelled when s is closed.
func (*BidiStream) IrohStream ¶
func (s *BidiStream) IrohStream() *iroh.Stream
IrohStream returns the underlying iroh stream.
func (*BidiStream) SetDeadline ¶
func (s *BidiStream) SetDeadline(t time.Time) error
SetDeadline sets read and write deadlines for s.
func (*BidiStream) SetReadDeadline ¶
func (s *BidiStream) SetReadDeadline(t time.Time) error
SetReadDeadline sets the read deadline for s.
func (*BidiStream) SetWriteDeadline ¶
func (s *BidiStream) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the write deadline for s.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn adapts an iroh.Conn to the stream and datagram operations used by HTTP/3 transports.
func (*Conn) AcceptBidi ¶
func (c *Conn) AcceptBidi(ctx context.Context) (*BidiStream, error)
AcceptBidi accepts a bidirectional stream.
func (*Conn) AcceptUni ¶
func (c *Conn) AcceptUni(ctx context.Context) (*ReceiveStream, error)
AcceptUni accepts a unidirectional receive stream.
func (*Conn) OpenBidi ¶
func (c *Conn) OpenBidi(ctx context.Context) (*BidiStream, error)
OpenBidi opens a bidirectional stream.
func (*Conn) OpenUni ¶
func (c *Conn) OpenUni(ctx context.Context) (*SendStream, error)
OpenUni opens a unidirectional send stream.
func (*Conn) ReceiveDatagram ¶
ReceiveDatagram receives an unreliable datagram.
func (*Conn) SendDatagram ¶
SendDatagram sends an unreliable datagram.
type ReceiveStream ¶
type ReceiveStream struct {
// contains filtered or unexported fields
}
ReceiveStream is an HTTP/3 unidirectional receive stream.
func (*ReceiveStream) CancelRead ¶
func (s *ReceiveStream) CancelRead(code uint64)
CancelRead aborts receiving on s with code.
func (*ReceiveStream) IrohReceiveStream ¶
func (s *ReceiveStream) IrohReceiveStream() *iroh.ReceiveStream
IrohReceiveStream returns the underlying iroh receive stream.
func (*ReceiveStream) SetReadDeadline ¶
func (s *ReceiveStream) SetReadDeadline(t time.Time) error
SetReadDeadline sets the read deadline for s.
type SendStream ¶
type SendStream struct {
// contains filtered or unexported fields
}
SendStream is an HTTP/3 unidirectional send stream.
func (*SendStream) CancelWrite ¶
func (s *SendStream) CancelWrite(code uint64)
CancelWrite aborts sending on s with code.
func (*SendStream) Context ¶
func (s *SendStream) Context() context.Context
Context is cancelled when s is closed.
func (*SendStream) IrohSendStream ¶
func (s *SendStream) IrohSendStream() *iroh.SendStream
IrohSendStream returns the underlying iroh send stream.
func (*SendStream) SetWriteDeadline ¶
func (s *SendStream) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the write deadline for s.