Documentation
¶
Index ¶
Constants ¶
const RecordSeparator byte = 0x1e
RecordSeparator is the record separator byte for the JSON-SEQ format
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionID ¶
type ConnectionID = protocol.ConnectionID
type Event ¶
type Event interface {
// Name returns the name of the event, as it should appear in the qlog output
Name() string
// Encode writes the event's data to the provided jsontext.Encoder
Encode(encoder *jsontext.Encoder, eventTime time.Time) error
}
Event represents a qlog event that can be encoded to JSON. Each event must provide its name and a method to encode itself using a jsontext.Encoder.
type FileSeq ¶
type FileSeq struct {
// contains filtered or unexported fields
}
FileSeq represents a qlog trace using the JSON-SEQ format, https://www.ietf.org/archive/id/draft-ietf-quic-qlog-main-schema-12.html#section-5 qlog event producers can be created by calling AddProducer. The underlying io.WriteCloser is closed when the last producer is removed.
func NewConnectionFileSeq ¶
func NewConnectionFileSeq(w io.WriteCloser, isClient bool, odcid ConnectionID, eventSchemas []string) *FileSeq
NewConnectionFileSeq creates a new qlog trace to log connection events.
func NewFileSeq ¶
func NewFileSeq(w io.WriteCloser) *FileSeq
NewFileSeq creates a new JSON-SEQ qlog trace to log transport events.
func (*FileSeq) AddProducer ¶
func (*FileSeq) SupportsSchemas ¶
type Recorder ¶
type Recorder interface {
// RecordEvent records a single Event to the trace.
// It must not be called after Close.
RecordEvent(Event)
// Close signals that this producer is done recording events.
// When all producers are closed, the underlying trace is closed.
// It must not be called concurrently with RecordEvent.
io.Closer
}
Recorder is used to record events to a qlog trace. It is safe for concurrent use by multiple goroutines.
type Trace ¶
type Trace interface {
// AddProducer creates a new Recorder for this trace.
// Each Recorder can record events independently.
AddProducer() Recorder
// SupportsSchemas returns true if the trace supports the given schema.
SupportsSchemas(schema string) bool
}
Trace represents a qlog trace that can have multiple event producers. Each producer can record events to the trace independently. When the last producer is closed, the underlying trace is closed as well.