mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
17 lines
447 B
Go
17 lines
447 B
Go
|
package clock
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
// Clock is an interface that provides a time functions for LND packages.
|
||
|
// This is useful during testing when a concrete time reference is needed.
|
||
|
type Clock interface {
|
||
|
// Now returns the current local time (as defined by the Clock).
|
||
|
Now() time.Time
|
||
|
|
||
|
// TickAfter returns a channel that will receive a tick after the specified
|
||
|
// duration has passed.
|
||
|
TickAfter(duration time.Duration) <-chan time.Time
|
||
|
}
|