blob: 0b1c17b81296d5135b591a5d9ee35d0f3c20f34c [file] [log] [blame]
Akash Reddy Kankanala92dfdf82025-03-23 22:07:09 +05301// Copyright 2024 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4package http2
5
6import "time"
7
8// A timer is a time.Timer, as an interface which can be replaced in tests.
9type timer = interface {
10 C() <-chan time.Time
11 Reset(d time.Duration) bool
12 Stop() bool
13}
14
15// timeTimer adapts a time.Timer to the timer interface.
16type timeTimer struct {
17 *time.Timer
18}
19
20func (t timeTimer) C() <-chan time.Time { return t.Timer.C }