qlog

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EventSchema = "urn:ietf:params:qlog:events:roq-01"

EventSchema is the qlog event schema for RTP over QUIC.

Variables

This section is empty.

Functions

func DefaultConnectionTracer

func DefaultConnectionTracer(ctx context.Context, isClient bool, connID quic.ConnectionID) qlogwriter.Trace

DefaultConnectionTracer creates a qlog trace that accepts both QUIC and RoQ events. Set it as quic.Config.Tracer to have a roq Session log its events into the same file as the QUIC transport events. Like quic-go's tracer, it writes to the directory named by the QLOGDIR environment variable and returns nil if QLOGDIR is not set.

Types

type DatagramPacketCreated

type DatagramPacketCreated struct {
	Packet Packet
}

DatagramPacketCreated is logged when a packet is sent as a datagram.

func (DatagramPacketCreated) Encode

func (DatagramPacketCreated) Name

func (e DatagramPacketCreated) Name() string

type DatagramPacketParsed

type DatagramPacketParsed struct {
	Packet Packet
}

DatagramPacketParsed is logged when a datagram is received.

func (DatagramPacketParsed) Encode

func (e DatagramPacketParsed) Encode(enc *jsontext.Encoder, _ time.Time) error

func (DatagramPacketParsed) Name

func (e DatagramPacketParsed) Name() string

type Packet

type Packet struct {
	FlowID uint64
	// Length is the length of the packet as it appears on the wire, including
	// the RoQ framing around it: the length prefix on a stream, or the flow ID
	// on a datagram.
	Length uint64
	Raw    RawInfo
}

Packet is the RoQ packet an event refers to.

type RawInfo

type RawInfo struct {
	// Length is the length of the packet as it appears on the wire, including
	// the RoQ framing around it: the length prefix on a stream, or the flow ID
	// on a datagram. The flow ID of a stream is sent once, ahead of its first
	// packet, and is not counted.
	Length uint64
	// PayloadLength is the length of the RTP or RTCP packet, without any RoQ
	// framing.
	PayloadLength uint64
	// Data is the packet as it appears on the wire, of Length bytes. It is
	// logged as a hex string and omitted when nil, which is what a Session
	// does unless it was created with roq.WithQlogPacketData. It may be
	// shorter than Length, because the session can be configured to keep only
	// the first few bytes of each packet.
	Data []byte
}

RawInfo describes the wire image of a packet.

func (RawInfo) HasValues

func (i RawInfo) HasValues() bool

type StreamOpened

type StreamOpened struct {
	FlowID   uint64
	StreamID uint64
}

StreamOpened is logged when a stream is opened for a flow.

func (StreamOpened) Encode

func (e StreamOpened) Encode(enc *jsontext.Encoder, _ time.Time) error

func (StreamOpened) Name

func (e StreamOpened) Name() string

type StreamPacketCreated

type StreamPacketCreated struct {
	StreamID uint64
	Packet   Packet
}

StreamPacketCreated is logged when a packet is written to a stream.

func (StreamPacketCreated) Encode

func (e StreamPacketCreated) Encode(enc *jsontext.Encoder, _ time.Time) error

func (StreamPacketCreated) Name

func (e StreamPacketCreated) Name() string

type StreamPacketParsed

type StreamPacketParsed struct {
	StreamID uint64
	Packet   Packet
}

StreamPacketParsed is logged when a packet is read from a stream.

func (StreamPacketParsed) Encode

func (e StreamPacketParsed) Encode(enc *jsontext.Encoder, _ time.Time) error

func (StreamPacketParsed) Name

func (e StreamPacketParsed) Name() string

Jump to

Keyboard shortcuts

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