uquic/internal/mocks/logging/mockgen.go
Benedikt Spies 31a677cacd
qlog: add support for alpn_information event (#4216)
* qlog chosen alpn

* qlog chosen alpn

* qlog: fix capitalization of ALPN

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-12-25 21:02:47 -08:00

52 lines
2.8 KiB
Go

//go:build gomock || generate
package mocklogging
import (
"net"
"time"
"github.com/quic-go/quic-go/logging"
)
//go:generate sh -c "go run go.uber.org/mock/mockgen -typed -build_flags=\"-tags=gomock\" -package internal -destination internal/tracer.go github.com/quic-go/quic-go/internal/mocks/logging Tracer"
type Tracer interface {
SentPacket(net.Addr, *logging.Header, logging.ByteCount, []logging.Frame)
SentVersionNegotiationPacket(_ net.Addr, dest, src logging.ArbitraryLenConnectionID, _ []logging.VersionNumber)
DroppedPacket(net.Addr, logging.PacketType, logging.ByteCount, logging.PacketDropReason)
}
//go:generate sh -c "go run go.uber.org/mock/mockgen -typed -build_flags=\"-tags=gomock\" -package internal -destination internal/connection_tracer.go github.com/quic-go/quic-go/internal/mocks/logging ConnectionTracer"
type ConnectionTracer interface {
StartedConnection(local, remote net.Addr, srcConnID, destConnID logging.ConnectionID)
NegotiatedVersion(chosen logging.VersionNumber, clientVersions, serverVersions []logging.VersionNumber)
ClosedConnection(error)
SentTransportParameters(*logging.TransportParameters)
ReceivedTransportParameters(*logging.TransportParameters)
RestoredTransportParameters(parameters *logging.TransportParameters) // for 0-RTT
SentLongHeaderPacket(*logging.ExtendedHeader, logging.ByteCount, logging.ECN, *logging.AckFrame, []logging.Frame)
SentShortHeaderPacket(*logging.ShortHeader, logging.ByteCount, logging.ECN, *logging.AckFrame, []logging.Frame)
ReceivedVersionNegotiationPacket(dest, src logging.ArbitraryLenConnectionID, _ []logging.VersionNumber)
ReceivedRetry(*logging.Header)
ReceivedLongHeaderPacket(*logging.ExtendedHeader, logging.ByteCount, logging.ECN, []logging.Frame)
ReceivedShortHeaderPacket(*logging.ShortHeader, logging.ByteCount, logging.ECN, []logging.Frame)
BufferedPacket(logging.PacketType, logging.ByteCount)
DroppedPacket(logging.PacketType, logging.PacketNumber, logging.ByteCount, logging.PacketDropReason)
UpdatedMetrics(rttStats *logging.RTTStats, cwnd, bytesInFlight logging.ByteCount, packetsInFlight int)
AcknowledgedPacket(logging.EncryptionLevel, logging.PacketNumber)
LostPacket(logging.EncryptionLevel, logging.PacketNumber, logging.PacketLossReason)
UpdatedCongestionState(logging.CongestionState)
UpdatedPTOCount(value uint32)
UpdatedKeyFromTLS(logging.EncryptionLevel, logging.Perspective)
UpdatedKey(generation logging.KeyPhase, remote bool)
DroppedEncryptionLevel(logging.EncryptionLevel)
DroppedKey(generation logging.KeyPhase)
SetLossTimer(logging.TimerType, logging.EncryptionLevel, time.Time)
LossTimerExpired(logging.TimerType, logging.EncryptionLevel)
LossTimerCanceled()
ECNStateUpdated(state logging.ECNState, trigger logging.ECNStateTrigger)
ChoseALPN(protocol string)
// Close is called when the connection is closed.
Close()
Debug(name, msg string)
}