transport

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID(strmID quic.StreamID) string

Types

type PoolConfig added in v0.0.2

type PoolConfig struct {
	MaxIdle     int           // maximum idle streams to keep in pool
	IdleTimeout time.Duration // max time a stream can be idle before eviction
	Enabled     bool          // whether pool is enabled
}

PoolConfig holds stream pool configuration.

type Stream

type Stream interface {
	io.ReadWriteCloser
	ID() string
	SetID(id string)
	Send(msg protocol.Parsable) error
	Receive() (*protocol.Message, error)

	SetSubdomain(subdomain string)

	Read(p []byte) (n int, err error)
	Write(p []byte) (n int, err error)
	CloseWrite() error
	Context() context.Context
}

type StreamHandler

type StreamHandler func(stream *quic.Stream) error

type Transport

type Transport interface {
	Addr() string
	Close()
	Acquire() (Stream, error)
	Release(stream Stream) error
	AcceptStream(ctx context.Context) (Stream, error)
	Len() int
	LenActive(subdomain ...string) int
	Root() Stream
	IsClosed() bool

	ImServer() bool
}

func New

func New(addr string) (Transport, error)

func NewFromServer

func NewFromServer(ctx context.Context, client *quic.Conn) (Transport, error)

Jump to

Keyboard shortcuts

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