Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
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 }
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 DefaultClock ¶
type DefaultClock struct{}
DefaultClock implements Clock interface by simply calling the appropriate time functions.
type TestClock ¶
type TestClock struct {
// contains filtered or unexported fields
}
TestClock can be used in tests to mock time.
func NewTestClock ¶
NewTestClock returns a new test clock.
func NewTestClockWithTickSignal ¶
NewTestClockWithTickSignal will create a new test clock with an added channel which will be used to signal when a new ticker is registered. This is useful when creating a ticker on a separate goroutine and we'd like to wait for that to happen before advancing the test case.
Click to show internal directories.
Click to hide internal directories.