Skip to content

Commit 44a5643

Browse files
authored
Merge pull request #1503 from apernet/dev/monotime
feat: migrate to new monotime congestion interface
2 parents 8809934 + f68d036 commit 44a5643

File tree

12 files changed

+54
-52
lines changed

12 files changed

+54
-52
lines changed

app/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ require (
3030

3131
require (
3232
github.com/andybalholm/brotli v1.1.0 // indirect
33-
github.com/apernet/quic-go v0.57.2-0.20260110201338-839e2640e302 // indirect
33+
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178 // indirect
3434
github.com/cloudflare/circl v1.3.9 // indirect
3535
github.com/database64128/netx-go v0.0.0-20240905055117-62795b8b054a // indirect
3636
github.com/database64128/tfo-go/v2 v2.2.2 // indirect

app/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1
4242
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
4343
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY=
4444
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM=
45-
github.com/apernet/quic-go v0.57.2-0.20260110201338-839e2640e302 h1:rVHGa7YsEe2Y06Do1BE6iKSh+GiGEOwvhyq591zqQFc=
46-
github.com/apernet/quic-go v0.57.2-0.20260110201338-839e2640e302/go.mod h1:N1WIjPphkqs4efXWuyDNQ6OjjIK04vM3h+bEgwV+eVU=
45+
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178 h1:bSq8n+gX4oO/qnM3MKf4kroW75n+phO9Qp6nigJKZ1E=
46+
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178/go.mod h1:N1WIjPphkqs4efXWuyDNQ6OjjIK04vM3h+bEgwV+eVU=
4747
github.com/apernet/sing-tun v0.2.6-0.20250920121535-299f04629986 h1:w62V0oOO2Do0vXeZkx7mgZ2YFuUaRcO6rNZewI3xzuE=
4848
github.com/apernet/sing-tun v0.2.6-0.20250920121535-299f04629986/go.mod h1:S5IydyLSN/QAfvY+r2GoomPJ6hidtXWm/Ad18sJVssk=
4949
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=

core/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24
55
toolchain go1.25.1
66

77
require (
8-
github.com/apernet/quic-go v0.57.2-0.20260110201338-839e2640e302
8+
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178
99
github.com/stretchr/testify v1.11.1
1010
go.uber.org/goleak v1.2.1
1111
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842

core/go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
github.com/apernet/quic-go v0.57.2-0.20260110201338-839e2640e302 h1:rVHGa7YsEe2Y06Do1BE6iKSh+GiGEOwvhyq591zqQFc=
1+
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178 h1:bSq8n+gX4oO/qnM3MKf4kroW75n+phO9Qp6nigJKZ1E=
2+
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178/go.mod h1:N1WIjPphkqs4efXWuyDNQ6OjjIK04vM3h+bEgwV+eVU=
23
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
34
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
45
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

core/internal/congestion/bbr/bandwidth_sampler.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ type maxAckHeightTracker struct {
103103
// bandwidth.
104104
maxAckHeightFilter *WindowedFilter[extraAckedEvent, roundTripCount]
105105
// The time this aggregation started and the number of bytes acked during it.
106-
aggregationEpochStartTime time.Time
106+
aggregationEpochStartTime congestion.Time
107107
aggregationEpochBytes congestion.ByteCount
108108
// The last sent packet number before the current aggregation epoch started.
109109
lastSentPacketNumberBeforeEpoch congestion.PacketNumber
@@ -133,7 +133,7 @@ func (m *maxAckHeightTracker) Update(
133133
roundTripCount roundTripCount,
134134
lastSentPacketNumber congestion.PacketNumber,
135135
lastAckedPacketNumber congestion.PacketNumber,
136-
ackTime time.Time,
136+
ackTime congestion.Time,
137137
bytesAcked congestion.ByteCount,
138138
) congestion.ByteCount {
139139
forceNewEpoch := false
@@ -241,7 +241,7 @@ func (m *maxAckHeightTracker) NumAckAggregationEpochs() uint64 {
241241

242242
// AckPoint represents a point on the ack line.
243243
type ackPoint struct {
244-
ackTime time.Time
244+
ackTime congestion.Time
245245
totalBytesAcked congestion.ByteCount
246246
}
247247

@@ -250,7 +250,7 @@ type recentAckPoints struct {
250250
ackPoints [2]ackPoint
251251
}
252252

253-
func (r *recentAckPoints) Update(ackTime time.Time, totalBytesAcked congestion.ByteCount) {
253+
func (r *recentAckPoints) Update(ackTime congestion.Time, totalBytesAcked congestion.ByteCount) {
254254
if ackTime.Before(r.ackPoints[1].ackTime) {
255255
r.ackPoints[1].ackTime = ackTime
256256
} else if ackTime.After(r.ackPoints[1].ackTime) {
@@ -284,18 +284,18 @@ func (r *recentAckPoints) LessRecentPoint() *ackPoint {
284284
// that moment.
285285
type connectionStateOnSentPacket struct {
286286
// Time at which the packet is sent.
287-
sentTime time.Time
287+
sentTime congestion.Time
288288
// Size of the packet.
289289
size congestion.ByteCount
290290
// The value of |totalBytesSentAtLastAckedPacket| at the time the
291291
// packet was sent.
292292
totalBytesSentAtLastAckedPacket congestion.ByteCount
293293
// The value of |lastAckedPacketSentTime| at the time the packet was
294294
// sent.
295-
lastAckedPacketSentTime time.Time
295+
lastAckedPacketSentTime congestion.Time
296296
// The value of |lastAckedPacketAckTime| at the time the packet was
297297
// sent.
298-
lastAckedPacketAckTime time.Time
298+
lastAckedPacketAckTime congestion.Time
299299
// Send time states that are returned to the congestion controller when the
300300
// packet is acked or lost.
301301
sendTimeState sendTimeState
@@ -305,7 +305,7 @@ type connectionStateOnSentPacket struct {
305305
// sampler.
306306
// |bytes_in_flight| is the bytes in flight right after the packet is sent.
307307
func newConnectionStateOnSentPacket(
308-
sentTime time.Time,
308+
sentTime congestion.Time,
309309
size congestion.ByteCount,
310310
bytesInFlight congestion.ByteCount,
311311
sampler *bandwidthSampler,
@@ -456,10 +456,10 @@ type bandwidthSampler struct {
456456

457457
// The time at which the last acknowledged packet was sent. Set to
458458
// QuicTime::Zero() if no valid timestamp is available.
459-
lastAckedPacketSentTime time.Time
459+
lastAckedPacketSentTime congestion.Time
460460

461461
// The time at which the most recent packet was acknowledged.
462-
lastAckedPacketAckTime time.Time
462+
lastAckedPacketAckTime congestion.Time
463463

464464
// The most recently sent packet.
465465
lastSentPacket congestion.PacketNumber
@@ -551,7 +551,7 @@ func (b *bandwidthSampler) IsOverestimateAvoidanceEnabled() bool {
551551
}
552552

553553
func (b *bandwidthSampler) OnPacketSent(
554-
sentTime time.Time,
554+
sentTime congestion.Time,
555555
packetNumber congestion.PacketNumber,
556556
bytes congestion.ByteCount,
557557
bytesInFlight congestion.ByteCount,
@@ -595,7 +595,7 @@ func (b *bandwidthSampler) OnPacketSent(
595595
}
596596

597597
func (b *bandwidthSampler) OnCongestionEvent(
598-
ackTime time.Time,
598+
ackTime congestion.Time,
599599
ackedPackets []congestion.AckedPacketInfo,
600600
lostPackets []congestion.LostPacketInfo,
601601
maxBandwidth Bandwidth,
@@ -758,7 +758,7 @@ func (b *bandwidthSampler) chooseA0Point(totalBytesAcked congestion.ByteCount, a
758758
return true
759759
}
760760

761-
func (b *bandwidthSampler) onPacketAcknowledged(ackTime time.Time, packetNumber congestion.PacketNumber) bandwidthSample {
761+
func (b *bandwidthSampler) onPacketAcknowledged(ackTime congestion.Time, packetNumber congestion.PacketNumber) bandwidthSample {
762762
sample := newBandwidthSample()
763763
b.lastAckedPacket = packetNumber
764764
sentPacketPointer := b.connectionStateMap.GetEntry(packetNumber)

core/internal/congestion/bbr/bbr_sender.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ type bbrSender struct {
130130
// triggers PROBE_RTT mode) if no new value is sampled during that period.
131131
minRtt time.Duration
132132
// The time at which the current value of |min_rtt_| was assigned.
133-
minRttTimestamp time.Time
133+
minRttTimestamp congestion.Time
134134

135135
// The maximum allowed number of bytes in flight.
136136
congestionWindow congestion.ByteCount
@@ -171,7 +171,7 @@ type bbrSender struct {
171171
// pacing gain cycle.
172172
cycleCurrentOffset int
173173
// The time at which the last pacing gain cycle was started.
174-
lastCycleStart time.Time
174+
lastCycleStart congestion.Time
175175

176176
// Indicates whether the connection has reached the full bandwidth mode.
177177
isAtFullBandwidth bool
@@ -186,7 +186,7 @@ type bbrSender struct {
186186
// Time at which PROBE_RTT has to be exited. Setting it to zero indicates
187187
// that the time is yet unknown as the number of packets in flight has not
188188
// reached the required value.
189-
exitProbeRttAt time.Time
189+
exitProbeRttAt congestion.Time
190190
// Indicates whether a round-trip has passed since PROBE_RTT became active.
191191
probeRttRoundPassed bool
192192

@@ -313,18 +313,18 @@ func (b *bbrSender) SetRTTStatsProvider(provider congestion.RTTStatsProvider) {
313313
}
314314

315315
// TimeUntilSend implements the SendAlgorithm interface.
316-
func (b *bbrSender) TimeUntilSend(bytesInFlight congestion.ByteCount) time.Time {
316+
func (b *bbrSender) TimeUntilSend(bytesInFlight congestion.ByteCount) congestion.Time {
317317
return b.pacer.TimeUntilSend()
318318
}
319319

320320
// HasPacingBudget implements the SendAlgorithm interface.
321-
func (b *bbrSender) HasPacingBudget(now time.Time) bool {
321+
func (b *bbrSender) HasPacingBudget(now congestion.Time) bool {
322322
return b.pacer.Budget(now) >= b.maxDatagramSize
323323
}
324324

325325
// OnPacketSent implements the SendAlgorithm interface.
326326
func (b *bbrSender) OnPacketSent(
327-
sentTime time.Time,
327+
sentTime congestion.Time,
328328
bytesInFlight congestion.ByteCount,
329329
packetNumber congestion.PacketNumber,
330330
bytes congestion.ByteCount,
@@ -353,7 +353,7 @@ func (b *bbrSender) MaybeExitSlowStart() {
353353
}
354354

355355
// OnPacketAcked implements the SendAlgorithm interface.
356-
func (b *bbrSender) OnPacketAcked(number congestion.PacketNumber, ackedBytes, priorInFlight congestion.ByteCount, eventTime time.Time) {
356+
func (b *bbrSender) OnPacketAcked(number congestion.PacketNumber, ackedBytes, priorInFlight congestion.ByteCount, eventTime congestion.Time) {
357357
// Do nothing.
358358
}
359359

@@ -407,7 +407,7 @@ func (b *bbrSender) OnCongestionEvent(number congestion.PacketNumber, lostBytes,
407407
// Do nothing.
408408
}
409409

410-
func (b *bbrSender) OnCongestionEventEx(priorInFlight congestion.ByteCount, eventTime time.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) {
410+
func (b *bbrSender) OnCongestionEventEx(priorInFlight congestion.ByteCount, eventTime congestion.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) {
411411
totalBytesAckedBefore := b.sampler.TotalBytesAcked()
412412
totalBytesLostBefore := b.sampler.TotalBytesLost()
413413

@@ -598,7 +598,7 @@ func (b *bbrSender) probeRttCongestionWindow() congestion.ByteCount {
598598
return b.minCongestionWindow
599599
}
600600

601-
func (b *bbrSender) maybeUpdateMinRtt(now time.Time, sampleMinRtt time.Duration) bool {
601+
func (b *bbrSender) maybeUpdateMinRtt(now congestion.Time, sampleMinRtt time.Duration) bool {
602602
// Do not expire min_rtt if none was ever available.
603603
minRttExpired := b.minRtt != 0 && now.After(b.minRttTimestamp.Add(minRttExpiry))
604604
if minRttExpired || sampleMinRtt < b.minRtt || b.minRtt == 0 {
@@ -610,7 +610,7 @@ func (b *bbrSender) maybeUpdateMinRtt(now time.Time, sampleMinRtt time.Duration)
610610
}
611611

612612
// Enters the STARTUP mode.
613-
func (b *bbrSender) enterStartupMode(now time.Time) {
613+
func (b *bbrSender) enterStartupMode(now congestion.Time) {
614614
b.mode = bbrModeStartup
615615
// b.maybeTraceStateChange(logging.CongestionStateStartup)
616616
b.pacingGain = b.highGain
@@ -622,7 +622,7 @@ func (b *bbrSender) enterStartupMode(now time.Time) {
622622
}
623623

624624
// Enters the PROBE_BW mode.
625-
func (b *bbrSender) enterProbeBandwidthMode(now time.Time) {
625+
func (b *bbrSender) enterProbeBandwidthMode(now congestion.Time) {
626626
b.mode = bbrModeProbeBw
627627
// b.maybeTraceStateChange(logging.CongestionStateProbeBw)
628628
b.congestionWindowGain = b.congestionWindowGainConstant
@@ -655,7 +655,7 @@ func (b *bbrSender) updateRoundTripCounter(lastAckedPacket congestion.PacketNumb
655655
}
656656

657657
// Updates the current gain used in PROBE_BW mode.
658-
func (b *bbrSender) updateGainCyclePhase(now time.Time, priorInFlight congestion.ByteCount, hasLosses bool) {
658+
func (b *bbrSender) updateGainCyclePhase(now congestion.Time, priorInFlight congestion.ByteCount, hasLosses bool) {
659659
// In most cases, the cycle is advanced after an RTT passes.
660660
shouldAdvanceGainCycling := now.After(b.lastCycleStart.Add(b.getMinRtt()))
661661
// If the pacing gain is above 1.0, the connection is trying to probe the
@@ -722,7 +722,7 @@ func (b *bbrSender) maybeAppLimited(bytesInFlight congestion.ByteCount) {
722722

723723
// Transitions from STARTUP to DRAIN and from DRAIN to PROBE_BW if
724724
// appropriate.
725-
func (b *bbrSender) maybeExitStartupOrDrain(now time.Time) {
725+
func (b *bbrSender) maybeExitStartupOrDrain(now congestion.Time) {
726726
if b.mode == bbrModeStartup && b.isAtFullBandwidth {
727727
b.mode = bbrModeDrain
728728
// b.maybeTraceStateChange(logging.CongestionStateDrain)
@@ -739,14 +739,14 @@ func (b *bbrSender) maybeExitStartupOrDrain(now time.Time) {
739739
}
740740

741741
// Decides whether to enter or exit PROBE_RTT.
742-
func (b *bbrSender) maybeEnterOrExitProbeRtt(now time.Time, isRoundStart, minRttExpired bool) {
742+
func (b *bbrSender) maybeEnterOrExitProbeRtt(now congestion.Time, isRoundStart, minRttExpired bool) {
743743
if minRttExpired && !b.exitingQuiescence && b.mode != bbrModeProbeRtt {
744744
b.mode = bbrModeProbeRtt
745745
// b.maybeTraceStateChange(logging.CongestionStateProbRtt)
746746
b.pacingGain = 1.0
747747
// Do not decide on the time to exit PROBE_RTT until the |bytes_in_flight|
748748
// is at the target small value.
749-
b.exitProbeRttAt = time.Time{}
749+
b.exitProbeRttAt = 0
750750

751751
if b.debug {
752752
b.debugPrint("BandwidthEstimate: %s, CongestionWindowGain: %.2f, PacingGain: %.2f, PacingRate: %s",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package bbr
22

3-
import "time"
3+
import "github.com/apernet/quic-go/congestion"
44

55
// A Clock returns the current time
66
type Clock interface {
7-
Now() time.Time
7+
Now() congestion.Time
88
}
99

1010
// DefaultClock implements the Clock interface using the Go stdlib clock.
@@ -13,6 +13,6 @@ type DefaultClock struct{}
1313
var _ Clock = DefaultClock{}
1414

1515
// Now gets the current time
16-
func (DefaultClock) Now() time.Time {
17-
return time.Now()
16+
func (DefaultClock) Now() congestion.Time {
17+
return congestion.Now()
1818
}

core/internal/congestion/brutal/brutal.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ func (b *BrutalSender) SetRTTStatsProvider(rttStats congestion.RTTStatsProvider)
6060
b.rttStats = rttStats
6161
}
6262

63-
func (b *BrutalSender) TimeUntilSend(bytesInFlight congestion.ByteCount) time.Time {
63+
func (b *BrutalSender) TimeUntilSend(bytesInFlight congestion.ByteCount) congestion.Time {
6464
return b.pacer.TimeUntilSend()
6565
}
6666

67-
func (b *BrutalSender) HasPacingBudget(now time.Time) bool {
67+
func (b *BrutalSender) HasPacingBudget(now congestion.Time) bool {
6868
return b.pacer.Budget(now) >= b.maxDatagramSize
6969
}
7070

@@ -84,14 +84,14 @@ func (b *BrutalSender) GetCongestionWindow() congestion.ByteCount {
8484
return cwnd
8585
}
8686

87-
func (b *BrutalSender) OnPacketSent(sentTime time.Time, bytesInFlight congestion.ByteCount,
87+
func (b *BrutalSender) OnPacketSent(sentTime congestion.Time, bytesInFlight congestion.ByteCount,
8888
packetNumber congestion.PacketNumber, bytes congestion.ByteCount, isRetransmittable bool,
8989
) {
9090
b.pacer.SentPacket(sentTime, bytes)
9191
}
9292

9393
func (b *BrutalSender) OnPacketAcked(number congestion.PacketNumber, ackedBytes congestion.ByteCount,
94-
priorInFlight congestion.ByteCount, eventTime time.Time,
94+
priorInFlight congestion.ByteCount, eventTime congestion.Time,
9595
) {
9696
// Stub
9797
}
@@ -102,8 +102,8 @@ func (b *BrutalSender) OnCongestionEvent(number congestion.PacketNumber, lostByt
102102
// Stub
103103
}
104104

105-
func (b *BrutalSender) OnCongestionEventEx(priorInFlight congestion.ByteCount, eventTime time.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) {
106-
currentTimestamp := eventTime.Unix()
105+
func (b *BrutalSender) OnCongestionEventEx(priorInFlight congestion.ByteCount, eventTime congestion.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) {
106+
currentTimestamp := int64(time.Duration(eventTime) / time.Second)
107107
slot := currentTimestamp % pktInfoSlotCount
108108
if b.pktInfoSlots[slot].Timestamp == currentTimestamp {
109109
b.pktInfoSlots[slot].LossCount += uint64(len(lostPackets))

core/internal/congestion/common/pacer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
type Pacer struct {
1616
budgetAtLastSent congestion.ByteCount
1717
maxDatagramSize congestion.ByteCount
18-
lastSentTime time.Time
18+
lastSentTime congestion.Time
1919
getBandwidth func() congestion.ByteCount // in bytes/s
2020
}
2121

@@ -28,7 +28,7 @@ func NewPacer(getBandwidth func() congestion.ByteCount) *Pacer {
2828
return p
2929
}
3030

31-
func (p *Pacer) SentPacket(sendTime time.Time, size congestion.ByteCount) {
31+
func (p *Pacer) SentPacket(sendTime congestion.Time, size congestion.ByteCount) {
3232
budget := p.Budget(sendTime)
3333
if size > budget {
3434
p.budgetAtLastSent = 0
@@ -38,7 +38,7 @@ func (p *Pacer) SentPacket(sendTime time.Time, size congestion.ByteCount) {
3838
p.lastSentTime = sendTime
3939
}
4040

41-
func (p *Pacer) Budget(now time.Time) congestion.ByteCount {
41+
func (p *Pacer) Budget(now congestion.Time) congestion.ByteCount {
4242
if p.lastSentTime.IsZero() {
4343
return p.maxBurstSize()
4444
}
@@ -57,10 +57,10 @@ func (p *Pacer) maxBurstSize() congestion.ByteCount {
5757
}
5858

5959
// TimeUntilSend returns when the next packet should be sent.
60-
// It returns the zero value of time.Time if a packet can be sent immediately.
61-
func (p *Pacer) TimeUntilSend() time.Time {
60+
// It returns the zero value if a packet can be sent immediately.
61+
func (p *Pacer) TimeUntilSend() congestion.Time {
6262
if p.budgetAtLastSent >= p.maxDatagramSize {
63-
return time.Time{}
63+
return 0
6464
}
6565
diff := 1e9 * uint64(p.maxDatagramSize-p.budgetAtLastSent)
6666
bw := uint64(p.getBandwidth())

extras/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ toolchain go1.25.1
66

77
require (
88
github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000
9-
github.com/apernet/quic-go v0.57.2-0.20260110201338-839e2640e302
9+
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178
1010
github.com/database64128/tfo-go/v2 v2.2.2
1111
github.com/hashicorp/golang-lru/v2 v2.0.5
1212
github.com/miekg/dns v1.1.59

0 commit comments

Comments
 (0)