Documentation
¶
Overview ¶
Package clock provides a decorator around gotd/td/clock to control and suppress native timers safely.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
Interceptor decorates a base clock.Clock, selectively neutralizing timers matching a specified duration (such as the default gotd ping loop interval).
func NewInterceptor ¶
func NewInterceptor(base clock.Clock, targetInterval time.Duration) *Interceptor
NewInterceptor constructs a new Interceptor. If base is nil, clock.System is used. If targetInterval is zero or negative, it defaults to 1 minute.
func (*Interceptor) Now ¶
func (i *Interceptor) Now() time.Time
Now returns the current time from the underlying base clock.
Click to show internal directories.
Click to hide internal directories.