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