github.com/MerlinKodo/quic-go@v0.39.2/internal/mocks/logging/mockgen.go (about) 1 //go:build gomock || generate 2 3 package mocklogging 4 5 import ( 6 "net" 7 "time" 8 9 "github.com/MerlinKodo/quic-go/logging" 10 ) 11 12 //go:generate sh -c "go run go.uber.org/mock/mockgen -build_flags=\"-tags=gomock\" -package internal -destination internal/tracer.go github.com/MerlinKodo/quic-go/internal/mocks/logging Tracer" 13 type Tracer interface { 14 SentPacket(net.Addr, *logging.Header, logging.ByteCount, []logging.Frame) 15 SentVersionNegotiationPacket(_ net.Addr, dest, src logging.ArbitraryLenConnectionID, _ []logging.VersionNumber) 16 DroppedPacket(net.Addr, logging.PacketType, logging.ByteCount, logging.PacketDropReason) 17 } 18 19 //go:generate sh -c "go run go.uber.org/mock/mockgen -build_flags=\"-tags=gomock\" -package internal -destination internal/connection_tracer.go github.com/MerlinKodo/quic-go/internal/mocks/logging ConnectionTracer" 20 type ConnectionTracer interface { 21 StartedConnection(local, remote net.Addr, srcConnID, destConnID logging.ConnectionID) 22 NegotiatedVersion(chosen logging.VersionNumber, clientVersions, serverVersions []logging.VersionNumber) 23 ClosedConnection(error) 24 SentTransportParameters(*logging.TransportParameters) 25 ReceivedTransportParameters(*logging.TransportParameters) 26 RestoredTransportParameters(parameters *logging.TransportParameters) // for 0-RTT 27 SentLongHeaderPacket(*logging.ExtendedHeader, logging.ByteCount, logging.ECN, *logging.AckFrame, []logging.Frame) 28 SentShortHeaderPacket(*logging.ShortHeader, logging.ByteCount, logging.ECN, *logging.AckFrame, []logging.Frame) 29 ReceivedVersionNegotiationPacket(dest, src logging.ArbitraryLenConnectionID, _ []logging.VersionNumber) 30 ReceivedRetry(*logging.Header) 31 ReceivedLongHeaderPacket(*logging.ExtendedHeader, logging.ByteCount, logging.ECN, []logging.Frame) 32 ReceivedShortHeaderPacket(*logging.ShortHeader, logging.ByteCount, logging.ECN, []logging.Frame) 33 BufferedPacket(logging.PacketType, logging.ByteCount) 34 DroppedPacket(logging.PacketType, logging.ByteCount, logging.PacketDropReason) 35 UpdatedMetrics(rttStats *logging.RTTStats, cwnd, bytesInFlight logging.ByteCount, packetsInFlight int) 36 AcknowledgedPacket(logging.EncryptionLevel, logging.PacketNumber) 37 LostPacket(logging.EncryptionLevel, logging.PacketNumber, logging.PacketLossReason) 38 UpdatedCongestionState(logging.CongestionState) 39 UpdatedPTOCount(value uint32) 40 UpdatedKeyFromTLS(logging.EncryptionLevel, logging.Perspective) 41 UpdatedKey(generation logging.KeyPhase, remote bool) 42 DroppedEncryptionLevel(logging.EncryptionLevel) 43 DroppedKey(generation logging.KeyPhase) 44 SetLossTimer(logging.TimerType, logging.EncryptionLevel, time.Time) 45 LossTimerExpired(logging.TimerType, logging.EncryptionLevel) 46 LossTimerCanceled() 47 ECNStateUpdated(state logging.ECNState, trigger logging.ECNStateTrigger) 48 // Close is called when the connection is closed. 49 Close() 50 Debug(name, msg string) 51 }