Documentation ¶
Overview ¶
Package logging defines a logging interface for quic-go. This package should not be considered stable
Index ¶
- Constants
- type AckFrame
- type AckRange
- type ApplicationError
- type ArbitraryLenConnectionID
- type ByteCount
- type CongestionState
- type ConnectionCloseFrame
- type ConnectionID
- type ConnectionTracer
- type CryptoFrame
- type DataBlockedFrame
- type DatagramFrame
- type EncryptionLevel
- type ExtendedHeader
- type Frame
- type HandshakeDoneFrame
- type Header
- type KeyPhase
- type KeyPhaseBit
- type MaxDataFrame
- type MaxStreamDataFrame
- type MaxStreamsFrame
- type NewConnectionIDFrame
- type NewTokenFrame
- type NullConnectionTracer
- func (n NullConnectionTracer) AcknowledgedPacket(EncryptionLevel, PacketNumber)
- func (n NullConnectionTracer) BufferedPacket(PacketType, ByteCount)
- func (n NullConnectionTracer) Close()
- func (n NullConnectionTracer) ClosedConnection(err error)
- func (n NullConnectionTracer) Debug(name, msg string)
- func (n NullConnectionTracer) DroppedEncryptionLevel(EncryptionLevel)
- func (n NullConnectionTracer) DroppedKey(KeyPhase)
- func (n NullConnectionTracer) DroppedPacket(PacketType, ByteCount, PacketDropReason)
- func (n NullConnectionTracer) LossTimerCanceled()
- func (n NullConnectionTracer) LossTimerExpired(timerType TimerType, level EncryptionLevel)
- func (n NullConnectionTracer) LostPacket(EncryptionLevel, PacketNumber, PacketLossReason)
- func (n NullConnectionTracer) NegotiatedVersion(chosen VersionNumber, clientVersions, serverVersions []VersionNumber)
- func (n NullConnectionTracer) ReceivedLongHeaderPacket(*ExtendedHeader, ByteCount, []Frame)
- func (n NullConnectionTracer) ReceivedRetry(*Header)
- func (n NullConnectionTracer) ReceivedShortHeaderPacket(*ShortHeader, ByteCount, []Frame)
- func (n NullConnectionTracer) ReceivedTransportParameters(*TransportParameters)
- func (n NullConnectionTracer) ReceivedVersionNegotiationPacket(dest, src ArbitraryLenConnectionID, _ []VersionNumber)
- func (n NullConnectionTracer) RestoredTransportParameters(*TransportParameters)
- func (n NullConnectionTracer) SentLongHeaderPacket(*ExtendedHeader, ByteCount, *AckFrame, []Frame)
- func (n NullConnectionTracer) SentShortHeaderPacket(*ShortHeader, ByteCount, *AckFrame, []Frame)
- func (n NullConnectionTracer) SentTransportParameters(*TransportParameters)
- func (n NullConnectionTracer) SetLossTimer(TimerType, EncryptionLevel, time.Time)
- func (n NullConnectionTracer) StartedConnection(local, remote net.Addr, srcConnID, destConnID ConnectionID)
- func (n NullConnectionTracer) UpdatedCongestionState(CongestionState)
- func (n NullConnectionTracer) UpdatedKey(keyPhase KeyPhase, remote bool)
- func (n NullConnectionTracer) UpdatedKeyFromTLS(EncryptionLevel, Perspective)
- func (n NullConnectionTracer) UpdatedMetrics(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int)
- func (n NullConnectionTracer) UpdatedPTOCount(uint32)
- type NullTracer
- type PacketDropReason
- type PacketLossReason
- type PacketNumber
- type PacketType
- type PathChallengeFrame
- type PathResponseFrame
- type Perspective
- type PingFrame
- type PreferredAddress
- type RTTStats
- type ResetStreamFrame
- type RetireConnectionIDFrame
- type ShortHeader
- type StatelessResetToken
- type StopSendingFrame
- type StreamDataBlockedFrame
- type StreamFrame
- type StreamID
- type StreamNum
- type StreamType
- type StreamsBlockedFrame
- type TimeoutReason
- type TimerType
- type Tracer
- type TransportError
- type TransportParameters
- type VersionNumber
Constants ¶
const ( // StreamTypeUni is a unidirectional stream StreamTypeUni = protocol.StreamTypeUni // StreamTypeBidi is a bidirectional stream StreamTypeBidi = protocol.StreamTypeBidi )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AckRange ¶
The AckRange is used within the AckFrame. It is a range of packet numbers that is being acknowledged.
type ApplicationError ¶
type ApplicationError = qerr.TransportErrorCode
An ApplicationError is an application-defined error code.
type ArbitraryLenConnectionID ¶
type ArbitraryLenConnectionID = protocol.ArbitraryLenConnectionID
An ArbitraryLenConnectionID is a QUIC Connection ID that can be up to 255 bytes long.
type CongestionState ¶
type CongestionState uint8
const ( // CongestionStateSlowStart is the slow start phase of Reno / Cubic CongestionStateSlowStart CongestionState = iota // CongestionStateCongestionAvoidance is the slow start phase of Reno / Cubic CongestionStateCongestionAvoidance // CongestionStateRecovery is the recovery phase of Reno / Cubic CongestionStateRecovery // CongestionStateApplicationLimited means that the congestion controller is application limited CongestionStateApplicationLimited )
type ConnectionCloseFrame ¶
type ConnectionCloseFrame = wire.ConnectionCloseFrame
A ConnectionCloseFrame is a CONNECTION_CLOSE frame.
type ConnectionID ¶
type ConnectionID = protocol.ConnectionID
A ConnectionID is a QUIC Connection ID.
type ConnectionTracer ¶
type ConnectionTracer interface { StartedConnection(local, remote net.Addr, srcConnID, destConnID ConnectionID) NegotiatedVersion(chosen VersionNumber, clientVersions, serverVersions []VersionNumber) ClosedConnection(error) SentTransportParameters(*TransportParameters) ReceivedTransportParameters(*TransportParameters) RestoredTransportParameters(parameters *TransportParameters) // for 0-RTT SentLongHeaderPacket(hdr *ExtendedHeader, size ByteCount, ack *AckFrame, frames []Frame) SentShortHeaderPacket(hdr *ShortHeader, size ByteCount, ack *AckFrame, frames []Frame) ReceivedVersionNegotiationPacket(dest, src ArbitraryLenConnectionID, _ []VersionNumber) ReceivedRetry(*Header) ReceivedLongHeaderPacket(hdr *ExtendedHeader, size ByteCount, frames []Frame) ReceivedShortHeaderPacket(hdr *ShortHeader, size ByteCount, frames []Frame) BufferedPacket(PacketType, ByteCount) DroppedPacket(PacketType, ByteCount, PacketDropReason) UpdatedMetrics(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int) AcknowledgedPacket(EncryptionLevel, PacketNumber) LostPacket(EncryptionLevel, PacketNumber, PacketLossReason) UpdatedCongestionState(CongestionState) UpdatedPTOCount(value uint32) UpdatedKeyFromTLS(EncryptionLevel, Perspective) UpdatedKey(generation KeyPhase, remote bool) DroppedEncryptionLevel(EncryptionLevel) DroppedKey(generation KeyPhase) SetLossTimer(TimerType, EncryptionLevel, time.Time) LossTimerExpired(TimerType, EncryptionLevel) LossTimerCanceled() // Close is called when the connection is closed. Close() Debug(name, msg string) }
A ConnectionTracer records events.
func NewMultiplexedConnectionTracer ¶
func NewMultiplexedConnectionTracer(tracers ...ConnectionTracer) ConnectionTracer
NewMultiplexedConnectionTracer creates a new connection tracer that multiplexes events to multiple tracers.
type CryptoFrame ¶
A CryptoFrame is a CRYPTO frame.
type DataBlockedFrame ¶
type DataBlockedFrame = wire.DataBlockedFrame
A DataBlockedFrame is a DATA_BLOCKED frame.
type DatagramFrame ¶
type DatagramFrame struct {
Length ByteCount
}
A DatagramFrame is a DATAGRAM frame.
type EncryptionLevel ¶
type EncryptionLevel = protocol.EncryptionLevel
The EncryptionLevel is the encryption level of a packet.
const ( // EncryptionInitial is the Initial encryption level EncryptionInitial EncryptionLevel = protocol.EncryptionInitial // EncryptionHandshake is the Handshake encryption level EncryptionHandshake EncryptionLevel = protocol.EncryptionHandshake // Encryption1RTT is the 1-RTT encryption level Encryption1RTT EncryptionLevel = protocol.Encryption1RTT // Encryption0RTT is the 0-RTT encryption level Encryption0RTT EncryptionLevel = protocol.Encryption0RTT )
type ExtendedHeader ¶
type ExtendedHeader = wire.ExtendedHeader
The ExtendedHeader is the QUIC Long Header packet header, after removing header protection.
type HandshakeDoneFrame ¶
type HandshakeDoneFrame = wire.HandshakeDoneFrame
A HandshakeDoneFrame is a HANDSHAKE_DONE frame.
type KeyPhaseBit ¶
type KeyPhaseBit = protocol.KeyPhaseBit
The KeyPhaseBit is the value of the key phase bit of the 1-RTT packets.
const ( // KeyPhaseZero is key phase bit 0 KeyPhaseZero KeyPhaseBit = protocol.KeyPhaseZero // KeyPhaseOne is key phase bit 1 KeyPhaseOne KeyPhaseBit = protocol.KeyPhaseOne )
type MaxStreamDataFrame ¶
type MaxStreamDataFrame = wire.MaxStreamDataFrame
A MaxStreamDataFrame is a MAX_STREAM_DATA frame.
type MaxStreamsFrame ¶
type MaxStreamsFrame = wire.MaxStreamsFrame
A MaxStreamsFrame is a MAX_STREAMS_FRAME.
type NewConnectionIDFrame ¶
type NewConnectionIDFrame = wire.NewConnectionIDFrame
A NewConnectionIDFrame is a NEW_CONNECTION_ID frame.
type NullConnectionTracer ¶
type NullConnectionTracer struct{}
The NullConnectionTracer is a ConnectionTracer that does nothing. It is useful for embedding.
func (NullConnectionTracer) AcknowledgedPacket ¶
func (n NullConnectionTracer) AcknowledgedPacket(EncryptionLevel, PacketNumber)
func (NullConnectionTracer) BufferedPacket ¶
func (n NullConnectionTracer) BufferedPacket(PacketType, ByteCount)
func (NullConnectionTracer) Close ¶
func (n NullConnectionTracer) Close()
func (NullConnectionTracer) ClosedConnection ¶
func (n NullConnectionTracer) ClosedConnection(err error)
func (NullConnectionTracer) Debug ¶
func (n NullConnectionTracer) Debug(name, msg string)
func (NullConnectionTracer) DroppedEncryptionLevel ¶
func (n NullConnectionTracer) DroppedEncryptionLevel(EncryptionLevel)
func (NullConnectionTracer) DroppedKey ¶
func (n NullConnectionTracer) DroppedKey(KeyPhase)
func (NullConnectionTracer) DroppedPacket ¶
func (n NullConnectionTracer) DroppedPacket(PacketType, ByteCount, PacketDropReason)
func (NullConnectionTracer) LossTimerCanceled ¶
func (n NullConnectionTracer) LossTimerCanceled()
func (NullConnectionTracer) LossTimerExpired ¶
func (n NullConnectionTracer) LossTimerExpired(timerType TimerType, level EncryptionLevel)
func (NullConnectionTracer) LostPacket ¶
func (n NullConnectionTracer) LostPacket(EncryptionLevel, PacketNumber, PacketLossReason)
func (NullConnectionTracer) NegotiatedVersion ¶
func (n NullConnectionTracer) NegotiatedVersion(chosen VersionNumber, clientVersions, serverVersions []VersionNumber)
func (NullConnectionTracer) ReceivedLongHeaderPacket ¶
func (n NullConnectionTracer) ReceivedLongHeaderPacket(*ExtendedHeader, ByteCount, []Frame)
func (NullConnectionTracer) ReceivedRetry ¶
func (n NullConnectionTracer) ReceivedRetry(*Header)
func (NullConnectionTracer) ReceivedShortHeaderPacket ¶
func (n NullConnectionTracer) ReceivedShortHeaderPacket(*ShortHeader, ByteCount, []Frame)
func (NullConnectionTracer) ReceivedTransportParameters ¶
func (n NullConnectionTracer) ReceivedTransportParameters(*TransportParameters)
func (NullConnectionTracer) ReceivedVersionNegotiationPacket ¶
func (n NullConnectionTracer) ReceivedVersionNegotiationPacket(dest, src ArbitraryLenConnectionID, _ []VersionNumber)
func (NullConnectionTracer) RestoredTransportParameters ¶
func (n NullConnectionTracer) RestoredTransportParameters(*TransportParameters)
func (NullConnectionTracer) SentLongHeaderPacket ¶
func (n NullConnectionTracer) SentLongHeaderPacket(*ExtendedHeader, ByteCount, *AckFrame, []Frame)
func (NullConnectionTracer) SentShortHeaderPacket ¶
func (n NullConnectionTracer) SentShortHeaderPacket(*ShortHeader, ByteCount, *AckFrame, []Frame)
func (NullConnectionTracer) SentTransportParameters ¶
func (n NullConnectionTracer) SentTransportParameters(*TransportParameters)
func (NullConnectionTracer) SetLossTimer ¶
func (n NullConnectionTracer) SetLossTimer(TimerType, EncryptionLevel, time.Time)
func (NullConnectionTracer) StartedConnection ¶
func (n NullConnectionTracer) StartedConnection(local, remote net.Addr, srcConnID, destConnID ConnectionID)
func (NullConnectionTracer) UpdatedCongestionState ¶
func (n NullConnectionTracer) UpdatedCongestionState(CongestionState)
func (NullConnectionTracer) UpdatedKey ¶
func (n NullConnectionTracer) UpdatedKey(keyPhase KeyPhase, remote bool)
func (NullConnectionTracer) UpdatedKeyFromTLS ¶
func (n NullConnectionTracer) UpdatedKeyFromTLS(EncryptionLevel, Perspective)
func (NullConnectionTracer) UpdatedMetrics ¶
func (n NullConnectionTracer) UpdatedMetrics(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int)
func (NullConnectionTracer) UpdatedPTOCount ¶
func (n NullConnectionTracer) UpdatedPTOCount(uint32)
type NullTracer ¶
type NullTracer struct{}
The NullTracer is a Tracer that does nothing. It is useful for embedding.
func (NullTracer) DroppedPacket ¶
func (n NullTracer) DroppedPacket(net.Addr, PacketType, ByteCount, PacketDropReason)
func (NullTracer) SentPacket ¶
func (NullTracer) SentVersionNegotiationPacket ¶
func (n NullTracer) SentVersionNegotiationPacket(_ net.Addr, dest, src ArbitraryLenConnectionID, _ []VersionNumber)
type PacketDropReason ¶
type PacketDropReason uint8
const ( PacketDropReason = iota // PacketDropUnknownConnectionID is used when a packet is dropped because the connection ID is unknown PacketDropUnknownConnectionID // PacketDropHeaderParseError is used when a packet is dropped because header parsing failed PacketDropHeaderParseError // PacketDropPayloadDecryptError is used when a packet is dropped because decrypting the payload failed PacketDropPayloadDecryptError // PacketDropProtocolViolation is used when a packet is dropped due to a protocol violation PacketDropProtocolViolation // PacketDropDOSPrevention is used when a packet is dropped to mitigate a DoS attack PacketDropDOSPrevention // PacketDropUnsupportedVersion is used when a packet is dropped because the version is not supported PacketDropUnsupportedVersion // PacketDropUnexpectedPacket is used when an unexpected packet is received PacketDropUnexpectedPacket // PacketDropUnexpectedSourceConnectionID is used when a packet with an unexpected source connection ID is received PacketDropUnexpectedSourceConnectionID // PacketDropUnexpectedVersion is used when a packet with an unexpected version is received PacketDropUnexpectedVersion // PacketDropDuplicate is used when a duplicate packet is received PacketDropDuplicate )PacketDropKeyUnavailable
type PacketLossReason ¶
type PacketLossReason uint8
const ( // PacketLossReorderingThreshold: when a packet is deemed lost due to reordering threshold PacketLossReorderingThreshold PacketLossReason = iota // PacketLossTimeThreshold: when a packet is deemed lost due to time threshold PacketLossTimeThreshold )
type PacketNumber ¶
type PacketNumber = protocol.PacketNumber
The PacketNumber is the packet number of a packet.
type PacketType ¶
type PacketType uint8
PacketType is the packet type of a QUIC packet
const ( // PacketTypeInitial is the packet type of an Initial packet PacketTypeInitial PacketType = iota // PacketTypeHandshake is the packet type of a Handshake packet PacketTypeHandshake // PacketTypeRetry is the packet type of a Retry packet PacketTypeRetry // PacketType0RTT is the packet type of a 0-RTT packet PacketType0RTT // PacketTypeVersionNegotiation is the packet type of a Version Negotiation packet PacketTypeVersionNegotiation // PacketType1RTT is a 1-RTT packet PacketType1RTT // PacketTypeStatelessReset is a stateless reset PacketTypeStatelessReset // PacketTypeNotDetermined is the packet type when it could not be determined PacketTypeNotDetermined )
func PacketTypeFromHeader ¶
func PacketTypeFromHeader(hdr *Header) PacketType
PacketTypeFromHeader determines the packet type from a *wire.Header.
type PathChallengeFrame ¶
type PathChallengeFrame = wire.PathChallengeFrame
A PathChallengeFrame is a PATH_CHALLENGE frame.
type PathResponseFrame ¶
type PathResponseFrame = wire.PathResponseFrame
A PathResponseFrame is a PATH_RESPONSE frame.
type Perspective ¶
type Perspective = protocol.Perspective
The Perspective is the role of a QUIC endpoint (client or server).
const ( // PerspectiveServer is used for a QUIC server PerspectiveServer Perspective = protocol.PerspectiveServer // PerspectiveClient is used for a QUIC client PerspectiveClient Perspective = protocol.PerspectiveClient )
type PreferredAddress ¶
type PreferredAddress = wire.PreferredAddress
The PreferredAddress is the preferred address sent in the transport parameters.
type ResetStreamFrame ¶
type ResetStreamFrame = wire.ResetStreamFrame
A ResetStreamFrame is a RESET_STREAM frame.
type RetireConnectionIDFrame ¶
type RetireConnectionIDFrame = wire.RetireConnectionIDFrame
A RetireConnectionIDFrame is a RETIRE_CONNECTION_ID frame.
type ShortHeader ¶
type ShortHeader struct { DestConnectionID ConnectionID PacketNumber PacketNumber PacketNumberLen protocol.PacketNumberLen KeyPhase KeyPhaseBit }
The ShortHeader is the QUIC Short Header packet header, after removing header protection.
type StatelessResetToken ¶
type StatelessResetToken = protocol.StatelessResetToken
A StatelessResetToken is a stateless reset token.
type StopSendingFrame ¶
type StopSendingFrame = wire.StopSendingFrame
A StopSendingFrame is a STOP_SENDING frame.
type StreamDataBlockedFrame ¶
type StreamDataBlockedFrame = wire.StreamDataBlockedFrame
A StreamDataBlockedFrame is a STREAM_DATA_BLOCKED frame.
type StreamFrame ¶
A StreamFrame is a STREAM frame.
type StreamType ¶
type StreamType = protocol.StreamType
The StreamType is the type of the stream (unidirectional or bidirectional).
type StreamsBlockedFrame ¶
type StreamsBlockedFrame = wire.StreamsBlockedFrame
A StreamsBlockedFrame is a STREAMS_BLOCKED frame.
type TimeoutReason ¶
type TimeoutReason uint8
TimeoutReason is the reason why a connection is closed
const ( // TimeoutReasonHandshake is used when the connection is closed due to a handshake timeout // This reason is not defined in the qlog draft, but very useful for debugging. TimeoutReasonHandshake TimeoutReason = iota // TimeoutReasonIdle is used when the connection is closed due to an idle timeout // This reason is not defined in the qlog draft, but very useful for debugging. TimeoutReasonIdle )
type Tracer ¶
type Tracer interface { SentPacket(net.Addr, *Header, ByteCount, []Frame) SentVersionNegotiationPacket(_ net.Addr, dest, src ArbitraryLenConnectionID, _ []VersionNumber) DroppedPacket(net.Addr, PacketType, ByteCount, PacketDropReason) }
A Tracer traces events.
func NewMultiplexedTracer ¶
NewMultiplexedTracer creates a new tracer that multiplexes events to multiple tracers.
type TransportError ¶
type TransportError = qerr.TransportErrorCode
A TransportError is a transport-level error code.
type TransportParameters ¶
type TransportParameters = wire.TransportParameters
The TransportParameters are QUIC transport parameters.
type VersionNumber ¶
type VersionNumber = protocol.VersionNumber
The VersionNumber is the QUIC version.