mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
vendor: clockwork v0.1.0
This commit is contained in:
parent
28b797b538
commit
3f0f4bfee7
18
cmd/vendor/github.com/jonboulle/clockwork/clockwork.go
generated
vendored
18
cmd/vendor/github.com/jonboulle/clockwork/clockwork.go
generated
vendored
@ -32,10 +32,17 @@ func NewRealClock() Clock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewFakeClock returns a FakeClock implementation which can be
|
// NewFakeClock returns a FakeClock implementation which can be
|
||||||
// manually advanced through time for testing.
|
// manually advanced through time for testing. The initial time of the
|
||||||
|
// FakeClock will be an arbitrary non-zero time.
|
||||||
func NewFakeClock() FakeClock {
|
func NewFakeClock() FakeClock {
|
||||||
|
// use a fixture that does not fulfill Time.IsZero()
|
||||||
|
return NewFakeClockAt(time.Date(1984, time.April, 4, 0, 0, 0, 0, time.UTC))
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFakeClockAt returns a FakeClock initialised at the given time.Time.
|
||||||
|
func NewFakeClockAt(t time.Time) FakeClock {
|
||||||
return &fakeClock{
|
return &fakeClock{
|
||||||
l: sync.RWMutex{},
|
time: t,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,9 +124,10 @@ func (fc *fakeClock) Sleep(d time.Duration) {
|
|||||||
|
|
||||||
// Time returns the current time of the fakeClock
|
// Time returns the current time of the fakeClock
|
||||||
func (fc *fakeClock) Now() time.Time {
|
func (fc *fakeClock) Now() time.Time {
|
||||||
fc.l.Lock()
|
fc.l.RLock()
|
||||||
defer fc.l.Unlock()
|
t := fc.time
|
||||||
return fc.time
|
fc.l.RUnlock()
|
||||||
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
// Advance advances fakeClock to a new point in time, ensuring channels from any
|
// Advance advances fakeClock to a new point in time, ensuring channels from any
|
||||||
|
6
glide.lock
generated
6
glide.lock
generated
@ -1,5 +1,5 @@
|
|||||||
hash: c04a6b4fa79b3e780e38f875e3863551c8a7e5a1d1020b9a3a06268d50e592e3
|
hash: 772308b285e752f35b2e87f75271501d23bbd9e72840dd1980fc6cf38a406b69
|
||||||
updated: 2016-08-15T15:51:12.533454067-07:00
|
updated: 2016-08-16T16:30:32.22550013-07:00
|
||||||
imports:
|
imports:
|
||||||
- name: bitbucket.org/ww/goautoneg
|
- name: bitbucket.org/ww/goautoneg
|
||||||
version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675
|
version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675
|
||||||
@ -64,7 +64,7 @@ imports:
|
|||||||
- name: github.com/inconshreveable/mousetrap
|
- name: github.com/inconshreveable/mousetrap
|
||||||
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
||||||
- name: github.com/jonboulle/clockwork
|
- name: github.com/jonboulle/clockwork
|
||||||
version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982
|
version: 2eee05ed794112d45db504eb05aa693efd2b8b09
|
||||||
- name: github.com/kballard/go-shellquote
|
- name: github.com/kballard/go-shellquote
|
||||||
version: d8ec1a69a250a17bb0e419c386eac1f3711dc142
|
version: d8ec1a69a250a17bb0e419c386eac1f3711dc142
|
||||||
- name: github.com/kr/pty
|
- name: github.com/kr/pty
|
||||||
|
@ -62,7 +62,7 @@ import:
|
|||||||
- package: github.com/inconshreveable/mousetrap
|
- package: github.com/inconshreveable/mousetrap
|
||||||
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
||||||
- package: github.com/jonboulle/clockwork
|
- package: github.com/jonboulle/clockwork
|
||||||
version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982
|
version: v0.1.0
|
||||||
- package: github.com/kballard/go-shellquote
|
- package: github.com/kballard/go-shellquote
|
||||||
version: d8ec1a69a250a17bb0e419c386eac1f3711dc142
|
version: d8ec1a69a250a17bb0e419c386eac1f3711dc142
|
||||||
- package: github.com/kr/pty
|
- package: github.com/kr/pty
|
||||||
|
Loading…
x
Reference in New Issue
Block a user