quicconn

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package quicconn adapts iroh connections to a QUIC-like surface.

It provides a small connection and stream surface over iroh.Conn so higher-level packages — an HTTP/3 stack, for example — can build on go-iroh without importing internal transport packages or adding another QUIC stack. The package implements no application protocol of its own.

The Go API is not stable before v1 and may change in any v0 release.

Index

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) Close

func (s *BidiStream) Close() error

Close closes the send side of s.

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) Read

func (s *BidiStream) Read(p []byte) (int, error)

Read reads from s.

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.

func (*BidiStream) Write

func (s *BidiStream) Write(p []byte) (int, error)

Write writes to 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 NewConn

func NewConn(c *iroh.Conn) *Conn

NewConn returns an HTTP/3 transport adapter for c.

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) Close

func (c *Conn) Close(code uint64, reason string) error

Close closes the connection with an HTTP/3 error code and reason.

func (*Conn) IrohConn

func (c *Conn) IrohConn() *iroh.Conn

IrohConn returns the underlying iroh connection.

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

func (c *Conn) ReceiveDatagram(ctx context.Context) ([]byte, error)

ReceiveDatagram receives an unreliable datagram.

func (*Conn) SendDatagram

func (c *Conn) SendDatagram(b []byte) error

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) Read

func (s *ReceiveStream) Read(p []byte) (int, error)

Read reads from s.

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) Close

func (s *SendStream) Close() error

Close closes s.

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.

func (*SendStream) Write

func (s *SendStream) Write(p []byte) (int, error)

Write writes to s.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL