Browse code

bump docker/swarmkit 59163bf75df38489d4a10392265d27156dc473c5

full diff: https://github.com/docker/swarmkit/compare/18e7e58ea1a5ec016625a636d0d52500eea123bc...59163bf75df38489d4a10392265d27156dc473c5

- Add missing return when configuring VXLAN port
- Prevent possible panic in cnmallocator.IsAttachmentAllocated()
- update github.com/pivotal-golang/clock
- new name for package: code.cloudfoundry.org/clock

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/04/16 01:04:36
Showing 18 changed files
... ...
@@ -131,7 +131,7 @@ github.com/containerd/ttrpc                         f02858b1457c5ca3aaec3a0803eb
131 131
 github.com/gogo/googleapis                          08a7655d27152912db7aaf4f983275eaf8d128ef
132 132
 
133 133
 # cluster
134
-github.com/docker/swarmkit                          18e7e58ea1a5ec016625a636d0d52500eea123bc
134
+github.com/docker/swarmkit                          59163bf75df38489d4a10392265d27156dc473c5
135 135
 github.com/gogo/protobuf                            4cbf7e384e768b4e01799441fdf2a706a5635ae7 # v1.2.0
136 136
 github.com/cloudflare/cfssl                         5d63dbd981b5c408effbb58c442d54761ff94fbd # 1.3.2
137 137
 github.com/fernet/fernet-go                         1b2437bc582b3cfbb341ee5a29f8ef5b42912ff2
... ...
@@ -142,7 +142,7 @@ github.com/hashicorp/go-memdb                       cb9a474f84cc5e41b273b20c6927
142 142
 github.com/hashicorp/go-immutable-radix             826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git
143 143
 github.com/hashicorp/golang-lru                     0fb14efe8c47ae851c0034ed7a448854d3d34cf3
144 144
 github.com/coreos/pkg                               3ac0863d7acf3bc44daf49afef8919af12f704ef # v3
145
-github.com/pivotal-golang/clock                     3fd3c1944c59d9742e1cd333672181cd1a6f9fa0
145
+code.cloudfoundry.org/clock                         02e53af36e6c978af692887ed449b74026d76fec
146 146
 
147 147
 # prometheus
148 148
 github.com/prometheus/client_golang                 c5b7fccd204277076155f10851dad72b76a49317 # v0.8.0
149 149
new file mode 100644
... ...
@@ -0,0 +1,201 @@
0
+                                 Apache License
1
+                           Version 2.0, January 2004
2
+                        http://www.apache.org/licenses/
3
+
4
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
5
+
6
+   1. Definitions.
7
+
8
+      "License" shall mean the terms and conditions for use, reproduction,
9
+      and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+      "Licensor" shall mean the copyright owner or entity authorized by
12
+      the copyright owner that is granting the License.
13
+
14
+      "Legal Entity" shall mean the union of the acting entity and all
15
+      other entities that control, are controlled by, or are under common
16
+      control with that entity. For the purposes of this definition,
17
+      "control" means (i) the power, direct or indirect, to cause the
18
+      direction or management of such entity, whether by contract or
19
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+      outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+      "You" (or "Your") shall mean an individual or Legal Entity
23
+      exercising permissions granted by this License.
24
+
25
+      "Source" form shall mean the preferred form for making modifications,
26
+      including but not limited to software source code, documentation
27
+      source, and configuration files.
28
+
29
+      "Object" form shall mean any form resulting from mechanical
30
+      transformation or translation of a Source form, including but
31
+      not limited to compiled object code, generated documentation,
32
+      and conversions to other media types.
33
+
34
+      "Work" shall mean the work of authorship, whether in Source or
35
+      Object form, made available under the License, as indicated by a
36
+      copyright notice that is included in or attached to the work
37
+      (an example is provided in the Appendix below).
38
+
39
+      "Derivative Works" shall mean any work, whether in Source or Object
40
+      form, that is based on (or derived from) the Work and for which the
41
+      editorial revisions, annotations, elaborations, or other modifications
42
+      represent, as a whole, an original work of authorship. For the purposes
43
+      of this License, Derivative Works shall not include works that remain
44
+      separable from, or merely link (or bind by name) to the interfaces of,
45
+      the Work and Derivative Works thereof.
46
+
47
+      "Contribution" shall mean any work of authorship, including
48
+      the original version of the Work and any modifications or additions
49
+      to that Work or Derivative Works thereof, that is intentionally
50
+      submitted to Licensor for inclusion in the Work by the copyright owner
51
+      or by an individual or Legal Entity authorized to submit on behalf of
52
+      the copyright owner. For the purposes of this definition, "submitted"
53
+      means any form of electronic, verbal, or written communication sent
54
+      to the Licensor or its representatives, including but not limited to
55
+      communication on electronic mailing lists, source code control systems,
56
+      and issue tracking systems that are managed by, or on behalf of, the
57
+      Licensor for the purpose of discussing and improving the Work, but
58
+      excluding communication that is conspicuously marked or otherwise
59
+      designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+      "Contributor" shall mean Licensor and any individual or Legal Entity
62
+      on behalf of whom a Contribution has been received by Licensor and
63
+      subsequently incorporated within the Work.
64
+
65
+   2. Grant of Copyright License. Subject to the terms and conditions of
66
+      this License, each Contributor hereby grants to You a perpetual,
67
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+      copyright license to reproduce, prepare Derivative Works of,
69
+      publicly display, publicly perform, sublicense, and distribute the
70
+      Work and such Derivative Works in Source or Object form.
71
+
72
+   3. Grant of Patent License. Subject to the terms and conditions of
73
+      this License, each Contributor hereby grants to You a perpetual,
74
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+      (except as stated in this section) patent license to make, have made,
76
+      use, offer to sell, sell, import, and otherwise transfer the Work,
77
+      where such license applies only to those patent claims licensable
78
+      by such Contributor that are necessarily infringed by their
79
+      Contribution(s) alone or by combination of their Contribution(s)
80
+      with the Work to which such Contribution(s) was submitted. If You
81
+      institute patent litigation against any entity (including a
82
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
83
+      or a Contribution incorporated within the Work constitutes direct
84
+      or contributory patent infringement, then any patent licenses
85
+      granted to You under this License for that Work shall terminate
86
+      as of the date such litigation is filed.
87
+
88
+   4. Redistribution. You may reproduce and distribute copies of the
89
+      Work or Derivative Works thereof in any medium, with or without
90
+      modifications, and in Source or Object form, provided that You
91
+      meet the following conditions:
92
+
93
+      (a) You must give any other recipients of the Work or
94
+          Derivative Works a copy of this License; and
95
+
96
+      (b) You must cause any modified files to carry prominent notices
97
+          stating that You changed the files; and
98
+
99
+      (c) You must retain, in the Source form of any Derivative Works
100
+          that You distribute, all copyright, patent, trademark, and
101
+          attribution notices from the Source form of the Work,
102
+          excluding those notices that do not pertain to any part of
103
+          the Derivative Works; and
104
+
105
+      (d) If the Work includes a "NOTICE" text file as part of its
106
+          distribution, then any Derivative Works that You distribute must
107
+          include a readable copy of the attribution notices contained
108
+          within such NOTICE file, excluding those notices that do not
109
+          pertain to any part of the Derivative Works, in at least one
110
+          of the following places: within a NOTICE text file distributed
111
+          as part of the Derivative Works; within the Source form or
112
+          documentation, if provided along with the Derivative Works; or,
113
+          within a display generated by the Derivative Works, if and
114
+          wherever such third-party notices normally appear. The contents
115
+          of the NOTICE file are for informational purposes only and
116
+          do not modify the License. You may add Your own attribution
117
+          notices within Derivative Works that You distribute, alongside
118
+          or as an addendum to the NOTICE text from the Work, provided
119
+          that such additional attribution notices cannot be construed
120
+          as modifying the License.
121
+
122
+      You may add Your own copyright statement to Your modifications and
123
+      may provide additional or different license terms and conditions
124
+      for use, reproduction, or distribution of Your modifications, or
125
+      for any such Derivative Works as a whole, provided Your use,
126
+      reproduction, and distribution of the Work otherwise complies with
127
+      the conditions stated in this License.
128
+
129
+   5. Submission of Contributions. Unless You explicitly state otherwise,
130
+      any Contribution intentionally submitted for inclusion in the Work
131
+      by You to the Licensor shall be under the terms and conditions of
132
+      this License, without any additional terms or conditions.
133
+      Notwithstanding the above, nothing herein shall supersede or modify
134
+      the terms of any separate license agreement you may have executed
135
+      with Licensor regarding such Contributions.
136
+
137
+   6. Trademarks. This License does not grant permission to use the trade
138
+      names, trademarks, service marks, or product names of the Licensor,
139
+      except as required for reasonable and customary use in describing the
140
+      origin of the Work and reproducing the content of the NOTICE file.
141
+
142
+   7. Disclaimer of Warranty. Unless required by applicable law or
143
+      agreed to in writing, Licensor provides the Work (and each
144
+      Contributor provides its Contributions) on an "AS IS" BASIS,
145
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146
+      implied, including, without limitation, any warranties or conditions
147
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148
+      PARTICULAR PURPOSE. You are solely responsible for determining the
149
+      appropriateness of using or redistributing the Work and assume any
150
+      risks associated with Your exercise of permissions under this License.
151
+
152
+   8. Limitation of Liability. In no event and under no legal theory,
153
+      whether in tort (including negligence), contract, or otherwise,
154
+      unless required by applicable law (such as deliberate and grossly
155
+      negligent acts) or agreed to in writing, shall any Contributor be
156
+      liable to You for damages, including any direct, indirect, special,
157
+      incidental, or consequential damages of any character arising as a
158
+      result of this License or out of the use or inability to use the
159
+      Work (including but not limited to damages for loss of goodwill,
160
+      work stoppage, computer failure or malfunction, or any and all
161
+      other commercial damages or losses), even if such Contributor
162
+      has been advised of the possibility of such damages.
163
+
164
+   9. Accepting Warranty or Additional Liability. While redistributing
165
+      the Work or Derivative Works thereof, You may choose to offer,
166
+      and charge a fee for, acceptance of support, warranty, indemnity,
167
+      or other liability obligations and/or rights consistent with this
168
+      License. However, in accepting such obligations, You may act only
169
+      on Your own behalf and on Your sole responsibility, not on behalf
170
+      of any other Contributor, and only if You agree to indemnify,
171
+      defend, and hold each Contributor harmless for any liability
172
+      incurred by, or claims asserted against, such Contributor by reason
173
+      of your accepting any such warranty or additional liability.
174
+
175
+   END OF TERMS AND CONDITIONS
176
+
177
+   APPENDIX: How to apply the Apache License to your work.
178
+
179
+      To apply the Apache License to your work, attach the following
180
+      boilerplate notice, with the fields enclosed by brackets "[]"
181
+      replaced with your own identifying information. (Don't include
182
+      the brackets!)  The text should be enclosed in the appropriate
183
+      comment syntax for the file format. We also recommend that a
184
+      file or class name and description of purpose be included on the
185
+      same "printed page" as the copyright notice for easier
186
+      identification within third-party archives.
187
+
188
+   Copyright [yyyy] [name of copyright owner]
189
+
190
+   Licensed under the Apache License, Version 2.0 (the "License");
191
+   you may not use this file except in compliance with the License.
192
+   You may obtain a copy of the License at
193
+
194
+       http://www.apache.org/licenses/LICENSE-2.0
195
+
196
+   Unless required by applicable law or agreed to in writing, software
197
+   distributed under the License is distributed on an "AS IS" BASIS,
198
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
199
+   See the License for the specific language governing permissions and
200
+   limitations under the License.
0 201
\ No newline at end of file
1 202
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved.
1
+
2
+This project contains software that is Copyright (c) 2015 Pivotal Software, Inc.
3
+
4
+Licensed under the Apache License, Version 2.0 (the "License");
5
+you may not use this file except in compliance with the License.
6
+You may obtain a copy of the License at
7
+
8
+   http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+Unless required by applicable law or agreed to in writing, software
11
+distributed under the License is distributed on an "AS IS" BASIS,
12
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+See the License for the specific language governing permissions and
14
+limitations under the License.
15
+
16
+This project may include a number of subcomponents with separate
17
+copyright notices and license terms. Your use of these subcomponents
18
+is subject to the terms and conditions of each subcomponent's license,
19
+as noted in the LICENSE file.
0 20
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+# clock
1
+
2
+**Note**: This repository should be imported as `code.cloudfoundry.org/clock`.
3
+
4
+Provides a `Clock` interface, useful for injecting time dependencies in tests.
0 5
new file mode 100644
... ...
@@ -0,0 +1,53 @@
0
+package clock
1
+
2
+import "time"
3
+
4
+type Clock interface {
5
+	Now() time.Time
6
+	Sleep(d time.Duration)
7
+	Since(t time.Time) time.Duration
8
+	// After waits for the duration to elapse and then sends the current time
9
+	// on the returned channel.
10
+	// It is equivalent to clock.NewTimer(d).C.
11
+	// The underlying Timer is not recovered by the garbage collector
12
+	// until the timer fires. If efficiency is a concern, use clock.NewTimer
13
+	// instead and call Timer.Stop if the timer is no longer needed.
14
+	After(d time.Duration) <-chan time.Time
15
+
16
+	NewTimer(d time.Duration) Timer
17
+	NewTicker(d time.Duration) Ticker
18
+}
19
+
20
+type realClock struct{}
21
+
22
+func NewClock() Clock {
23
+	return &realClock{}
24
+}
25
+
26
+func (clock *realClock) Now() time.Time {
27
+	return time.Now()
28
+}
29
+
30
+func (clock *realClock) Since(t time.Time) time.Duration {
31
+	return time.Now().Sub(t)
32
+}
33
+
34
+func (clock *realClock) Sleep(d time.Duration) {
35
+	<-clock.NewTimer(d).C()
36
+}
37
+
38
+func (clock *realClock) After(d time.Duration) <-chan time.Time {
39
+	return clock.NewTimer(d).C()
40
+}
41
+
42
+func (clock *realClock) NewTimer(d time.Duration) Timer {
43
+	return &realTimer{
44
+		t: time.NewTimer(d),
45
+	}
46
+}
47
+
48
+func (clock *realClock) NewTicker(d time.Duration) Ticker {
49
+	return &realTicker{
50
+		t: time.NewTicker(d),
51
+	}
52
+}
0 53
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+package clock // import "code.cloudfoundry.org/clock"
0 1
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+package clock
1
+
2
+import "time"
3
+
4
+type Ticker interface {
5
+	C() <-chan time.Time
6
+	Stop()
7
+}
8
+
9
+type realTicker struct {
10
+	t *time.Ticker
11
+}
12
+
13
+func (t *realTicker) C() <-chan time.Time {
14
+	return t.t.C
15
+}
16
+
17
+func (t *realTicker) Stop() {
18
+	t.t.Stop()
19
+}
0 20
new file mode 100644
... ...
@@ -0,0 +1,25 @@
0
+package clock
1
+
2
+import "time"
3
+
4
+type Timer interface {
5
+	C() <-chan time.Time
6
+	Reset(d time.Duration) bool
7
+	Stop() bool
8
+}
9
+
10
+type realTimer struct {
11
+	t *time.Timer
12
+}
13
+
14
+func (t *realTimer) C() <-chan time.Time {
15
+	return t.t.C
16
+}
17
+
18
+func (t *realTimer) Reset(d time.Duration) bool {
19
+	return t.t.Reset(d)
20
+}
21
+
22
+func (t *realTimer) Stop() bool {
23
+	return t.t.Stop()
24
+}
... ...
@@ -485,7 +485,7 @@ func (na *cnmNetworkAllocator) IsAttachmentAllocated(node *api.Node, networkAtta
485 485
 		return false
486 486
 	}
487 487
 
488
-	if networkAttachment == nil {
488
+	if networkAttachment == nil || networkAttachment.Network == nil {
489 489
 		return false
490 490
 	}
491 491
 
... ...
@@ -4,12 +4,12 @@ import (
4 4
 	"context"
5 5
 	"time"
6 6
 
7
+	"code.cloudfoundry.org/clock"
7 8
 	"github.com/docker/swarmkit/api"
8 9
 	"github.com/docker/swarmkit/log"
9 10
 	"github.com/docker/swarmkit/manager/state/raft"
10 11
 	"github.com/docker/swarmkit/manager/state/raft/membership"
11 12
 	"github.com/docker/swarmkit/manager/state/store"
12
-	"github.com/pivotal-golang/clock"
13 13
 )
14 14
 
15 15
 const (
... ...
@@ -11,6 +11,7 @@ import (
11 11
 	"sync/atomic"
12 12
 	"time"
13 13
 
14
+	"code.cloudfoundry.org/clock"
14 15
 	"github.com/coreos/etcd/pkg/idutil"
15 16
 	"github.com/coreos/etcd/raft"
16 17
 	"github.com/coreos/etcd/raft/raftpb"
... ...
@@ -28,7 +29,6 @@ import (
28 28
 	"github.com/docker/swarmkit/manager/state/store"
29 29
 	"github.com/docker/swarmkit/watch"
30 30
 	"github.com/gogo/protobuf/proto"
31
-	"github.com/pivotal-golang/clock"
32 31
 	"github.com/pkg/errors"
33 32
 	"github.com/sirupsen/logrus"
34 33
 	"golang.org/x/time/rate"
... ...
@@ -274,9 +274,10 @@ func (n *Node) currentRole() api.NodeRole {
274 274
 // configVXLANUDPPort sets vxlan port in libnetwork
275 275
 func configVXLANUDPPort(ctx context.Context, vxlanUDPPort uint32) {
276 276
 	if err := overlayutils.ConfigVXLANUDPPort(vxlanUDPPort); err != nil {
277
-		log.G(ctx).WithError(err).Error("Configuring VXLAN port failed")
277
+		log.G(ctx).WithError(err).Error("failed to configure VXLAN UDP port")
278
+		return
278 279
 	}
279
-	logrus.Infof(" Swarm successfully initialized VXLAN UDP Port to %d ", vxlanUDPPort)
280
+	logrus.Infof("initialized VXLAN UDP port to %d ", vxlanUDPPort)
280 281
 }
281 282
 
282 283
 func (n *Node) run(ctx context.Context) (err error) {
... ...
@@ -8,7 +8,7 @@
8 8
 # In >=1.11, those errors were brought back but the string had changed again.
9 9
 # After updating GRPC, if integration test failures occur, verify that the
10 10
 # string matching there is correct.
11
-google.golang.org/grpc v1.12.0
11
+google.golang.org/grpc 7a6a684ca69eb4cae85ad0a484f2e531598c047b # v1.12.2
12 12
 github.com/gogo/protobuf v1.0.0
13 13
 github.com/golang/protobuf v1.1.0
14 14
 github.com/matttproud/golang_protobuf_extensions v1.0.0
... ...
@@ -39,7 +39,7 @@ github.com/opencontainers/go-digest v1.0.0-rc1
39 39
 github.com/opencontainers/image-spec v1.0.1
40 40
 github.com/ishidawataru/sctp 07191f837fedd2f13d1ec7b5f885f0f3ec54b1cb
41 41
 
42
-github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76 # v1.1.0
42
+github.com/davecgh/go-spew  8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1
43 43
 github.com/Microsoft/go-winio v0.4.11
44 44
 github.com/sirupsen/logrus v1.0.6
45 45
 github.com/beorn7/perks 3a771d992973f24aa725d07868b467d1ddfceaf
... ...
@@ -52,15 +52,15 @@ github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad
52 52
 github.com/hashicorp/golang-lru 0fb14efe8c47ae851c0034ed7a448854d3d34cf3
53 53
 github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
54 54
 github.com/phayes/permbits f7e3ac5e859d0b919c5068d581cc4c5d4f4f9bc5
55
-github.com/pivotal-golang/clock 3fd3c1944c59d9742e1cd333672181cd1a6f9fa0
55
+code.cloudfoundry.org/clock 02e53af36e6c978af692887ed449b74026d76fec
56 56
 github.com/pkg/errors 645ef00459ed84a119197bfb8d8205042c6df63d
57
-github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2
57
+github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2 # v1.0.0
58 58
 github.com/rcrowley/go-metrics 51425a2415d21afadfd55cd93432c0bc69e9598d
59 59
 github.com/spf13/cobra 8e91712f174ced10270cf66615e0a9127e7c4de5
60 60
 github.com/spf13/pflag 7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7
61
-github.com/stretchr/testify v1.1.4
61
+github.com/stretchr/testify ffdc059bfe9ce6a4e144ba849dbedead332c6053 # v1.3.0
62 62
 go.etcd.io/bbolt v1.3.1-etcd.8
63
-golang.org/x/crypto 0709b304e793a5edb4a2c0145f281ecdc20838a4
63
+golang.org/x/crypto b7391e95e576cacdcdd422573063bc057239113d
64 64
 golang.org/x/net a680a1efc54dd51c040b3b5ce4939ea3cf2ea0d1
65 65
 golang.org/x/sys 90868a75fefd03942536221d7c0e2f84ec62a668
66 66
 golang.org/x/text f21a4dfb5e38f5895301dc265a8def02365cc3d0 # v0.3.0
67 67
deleted file mode 100644
... ...
@@ -1,202 +0,0 @@
1
-Apache License
2
-                           Version 2.0, January 2004
3
-                        http://www.apache.org/licenses/
4
-
5
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
-   1. Definitions.
8
-
9
-      "License" shall mean the terms and conditions for use, reproduction,
10
-      and distribution as defined by Sections 1 through 9 of this document.
11
-
12
-      "Licensor" shall mean the copyright owner or entity authorized by
13
-      the copyright owner that is granting the License.
14
-
15
-      "Legal Entity" shall mean the union of the acting entity and all
16
-      other entities that control, are controlled by, or are under common
17
-      control with that entity. For the purposes of this definition,
18
-      "control" means (i) the power, direct or indirect, to cause the
19
-      direction or management of such entity, whether by contract or
20
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
-      outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
-      "You" (or "Your") shall mean an individual or Legal Entity
24
-      exercising permissions granted by this License.
25
-
26
-      "Source" form shall mean the preferred form for making modifications,
27
-      including but not limited to software source code, documentation
28
-      source, and configuration files.
29
-
30
-      "Object" form shall mean any form resulting from mechanical
31
-      transformation or translation of a Source form, including but
32
-      not limited to compiled object code, generated documentation,
33
-      and conversions to other media types.
34
-
35
-      "Work" shall mean the work of authorship, whether in Source or
36
-      Object form, made available under the License, as indicated by a
37
-      copyright notice that is included in or attached to the work
38
-      (an example is provided in the Appendix below).
39
-
40
-      "Derivative Works" shall mean any work, whether in Source or Object
41
-      form, that is based on (or derived from) the Work and for which the
42
-      editorial revisions, annotations, elaborations, or other modifications
43
-      represent, as a whole, an original work of authorship. For the purposes
44
-      of this License, Derivative Works shall not include works that remain
45
-      separable from, or merely link (or bind by name) to the interfaces of,
46
-      the Work and Derivative Works thereof.
47
-
48
-      "Contribution" shall mean any work of authorship, including
49
-      the original version of the Work and any modifications or additions
50
-      to that Work or Derivative Works thereof, that is intentionally
51
-      submitted to Licensor for inclusion in the Work by the copyright owner
52
-      or by an individual or Legal Entity authorized to submit on behalf of
53
-      the copyright owner. For the purposes of this definition, "submitted"
54
-      means any form of electronic, verbal, or written communication sent
55
-      to the Licensor or its representatives, including but not limited to
56
-      communication on electronic mailing lists, source code control systems,
57
-      and issue tracking systems that are managed by, or on behalf of, the
58
-      Licensor for the purpose of discussing and improving the Work, but
59
-      excluding communication that is conspicuously marked or otherwise
60
-      designated in writing by the copyright owner as "Not a Contribution."
61
-
62
-      "Contributor" shall mean Licensor and any individual or Legal Entity
63
-      on behalf of whom a Contribution has been received by Licensor and
64
-      subsequently incorporated within the Work.
65
-
66
-   2. Grant of Copyright License. Subject to the terms and conditions of
67
-      this License, each Contributor hereby grants to You a perpetual,
68
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
-      copyright license to reproduce, prepare Derivative Works of,
70
-      publicly display, publicly perform, sublicense, and distribute the
71
-      Work and such Derivative Works in Source or Object form.
72
-
73
-   3. Grant of Patent License. Subject to the terms and conditions of
74
-      this License, each Contributor hereby grants to You a perpetual,
75
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
-      (except as stated in this section) patent license to make, have made,
77
-      use, offer to sell, sell, import, and otherwise transfer the Work,
78
-      where such license applies only to those patent claims licensable
79
-      by such Contributor that are necessarily infringed by their
80
-      Contribution(s) alone or by combination of their Contribution(s)
81
-      with the Work to which such Contribution(s) was submitted. If You
82
-      institute patent litigation against any entity (including a
83
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
-      or a Contribution incorporated within the Work constitutes direct
85
-      or contributory patent infringement, then any patent licenses
86
-      granted to You under this License for that Work shall terminate
87
-      as of the date such litigation is filed.
88
-
89
-   4. Redistribution. You may reproduce and distribute copies of the
90
-      Work or Derivative Works thereof in any medium, with or without
91
-      modifications, and in Source or Object form, provided that You
92
-      meet the following conditions:
93
-
94
-      (a) You must give any other recipients of the Work or
95
-          Derivative Works a copy of this License; and
96
-
97
-      (b) You must cause any modified files to carry prominent notices
98
-          stating that You changed the files; and
99
-
100
-      (c) You must retain, in the Source form of any Derivative Works
101
-          that You distribute, all copyright, patent, trademark, and
102
-          attribution notices from the Source form of the Work,
103
-          excluding those notices that do not pertain to any part of
104
-          the Derivative Works; and
105
-
106
-      (d) If the Work includes a "NOTICE" text file as part of its
107
-          distribution, then any Derivative Works that You distribute must
108
-          include a readable copy of the attribution notices contained
109
-          within such NOTICE file, excluding those notices that do not
110
-          pertain to any part of the Derivative Works, in at least one
111
-          of the following places: within a NOTICE text file distributed
112
-          as part of the Derivative Works; within the Source form or
113
-          documentation, if provided along with the Derivative Works; or,
114
-          within a display generated by the Derivative Works, if and
115
-          wherever such third-party notices normally appear. The contents
116
-          of the NOTICE file are for informational purposes only and
117
-          do not modify the License. You may add Your own attribution
118
-          notices within Derivative Works that You distribute, alongside
119
-          or as an addendum to the NOTICE text from the Work, provided
120
-          that such additional attribution notices cannot be construed
121
-          as modifying the License.
122
-
123
-      You may add Your own copyright statement to Your modifications and
124
-      may provide additional or different license terms and conditions
125
-      for use, reproduction, or distribution of Your modifications, or
126
-      for any such Derivative Works as a whole, provided Your use,
127
-      reproduction, and distribution of the Work otherwise complies with
128
-      the conditions stated in this License.
129
-
130
-   5. Submission of Contributions. Unless You explicitly state otherwise,
131
-      any Contribution intentionally submitted for inclusion in the Work
132
-      by You to the Licensor shall be under the terms and conditions of
133
-      this License, without any additional terms or conditions.
134
-      Notwithstanding the above, nothing herein shall supersede or modify
135
-      the terms of any separate license agreement you may have executed
136
-      with Licensor regarding such Contributions.
137
-
138
-   6. Trademarks. This License does not grant permission to use the trade
139
-      names, trademarks, service marks, or product names of the Licensor,
140
-      except as required for reasonable and customary use in describing the
141
-      origin of the Work and reproducing the content of the NOTICE file.
142
-
143
-   7. Disclaimer of Warranty. Unless required by applicable law or
144
-      agreed to in writing, Licensor provides the Work (and each
145
-      Contributor provides its Contributions) on an "AS IS" BASIS,
146
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
-      implied, including, without limitation, any warranties or conditions
148
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
-      PARTICULAR PURPOSE. You are solely responsible for determining the
150
-      appropriateness of using or redistributing the Work and assume any
151
-      risks associated with Your exercise of permissions under this License.
152
-
153
-   8. Limitation of Liability. In no event and under no legal theory,
154
-      whether in tort (including negligence), contract, or otherwise,
155
-      unless required by applicable law (such as deliberate and grossly
156
-      negligent acts) or agreed to in writing, shall any Contributor be
157
-      liable to You for damages, including any direct, indirect, special,
158
-      incidental, or consequential damages of any character arising as a
159
-      result of this License or out of the use or inability to use the
160
-      Work (including but not limited to damages for loss of goodwill,
161
-      work stoppage, computer failure or malfunction, or any and all
162
-      other commercial damages or losses), even if such Contributor
163
-      has been advised of the possibility of such damages.
164
-
165
-   9. Accepting Warranty or Additional Liability. While redistributing
166
-      the Work or Derivative Works thereof, You may choose to offer,
167
-      and charge a fee for, acceptance of support, warranty, indemnity,
168
-      or other liability obligations and/or rights consistent with this
169
-      License. However, in accepting such obligations, You may act only
170
-      on Your own behalf and on Your sole responsibility, not on behalf
171
-      of any other Contributor, and only if You agree to indemnify,
172
-      defend, and hold each Contributor harmless for any liability
173
-      incurred by, or claims asserted against, such Contributor by reason
174
-      of your accepting any such warranty or additional liability.
175
-
176
-   END OF TERMS AND CONDITIONS
177
-
178
-   APPENDIX: How to apply the Apache License to your work.
179
-
180
-      To apply the Apache License to your work, attach the following
181
-      boilerplate notice, with the fields enclosed by brackets "{}"
182
-      replaced with your own identifying information. (Don't include
183
-      the brackets!)  The text should be enclosed in the appropriate
184
-      comment syntax for the file format. We also recommend that a
185
-      file or class name and description of purpose be included on the
186
-      same "printed page" as the copyright notice for easier
187
-      identification within third-party archives.
188
-
189
-   Copyright {yyyy} {name of copyright owner}
190
-
191
-   Licensed under the Apache License, Version 2.0 (the "License");
192
-   you may not use this file except in compliance with the License.
193
-   You may obtain a copy of the License at
194
-
195
-       http://www.apache.org/licenses/LICENSE-2.0
196
-
197
-   Unless required by applicable law or agreed to in writing, software
198
-   distributed under the License is distributed on an "AS IS" BASIS,
199
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
-   See the License for the specific language governing permissions and
201
-   limitations under the License.
202
-
203 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-Provides a `Clock` interface, useful for injecting time dependencies in tests.
2 1
deleted file mode 100644
... ...
@@ -1,42 +0,0 @@
1
-package clock
2
-
3
-import "time"
4
-
5
-type Clock interface {
6
-	Now() time.Time
7
-	Sleep(d time.Duration)
8
-	Since(t time.Time) time.Duration
9
-
10
-	NewTimer(d time.Duration) Timer
11
-	NewTicker(d time.Duration) Ticker
12
-}
13
-
14
-type realClock struct{}
15
-
16
-func NewClock() Clock {
17
-	return &realClock{}
18
-}
19
-
20
-func (clock *realClock) Now() time.Time {
21
-	return time.Now()
22
-}
23
-
24
-func (clock *realClock) Since(t time.Time) time.Duration {
25
-	return time.Now().Sub(t)
26
-}
27
-
28
-func (clock *realClock) Sleep(d time.Duration) {
29
-	<-clock.NewTimer(d).C()
30
-}
31
-
32
-func (clock *realClock) NewTimer(d time.Duration) Timer {
33
-	return &realTimer{
34
-		t: time.NewTimer(d),
35
-	}
36
-}
37
-
38
-func (clock *realClock) NewTicker(d time.Duration) Ticker {
39
-	return &realTicker{
40
-		t: time.NewTicker(d),
41
-	}
42
-}
43 1
deleted file mode 100644
... ...
@@ -1,20 +0,0 @@
1
-package clock
2
-
3
-import "time"
4
-
5
-type Ticker interface {
6
-	C() <-chan time.Time
7
-	Stop()
8
-}
9
-
10
-type realTicker struct {
11
-	t *time.Ticker
12
-}
13
-
14
-func (t *realTicker) C() <-chan time.Time {
15
-	return t.t.C
16
-}
17
-
18
-func (t *realTicker) Stop() {
19
-	t.t.Stop()
20
-}
21 1
deleted file mode 100644
... ...
@@ -1,25 +0,0 @@
1
-package clock
2
-
3
-import "time"
4
-
5
-type Timer interface {
6
-	C() <-chan time.Time
7
-	Reset(d time.Duration) bool
8
-	Stop() bool
9
-}
10
-
11
-type realTimer struct {
12
-	t *time.Timer
13
-}
14
-
15
-func (t *realTimer) C() <-chan time.Time {
16
-	return t.t.C
17
-}
18
-
19
-func (t *realTimer) Reset(d time.Duration) bool {
20
-	return t.t.Reset(d)
21
-}
22
-
23
-func (t *realTimer) Stop() bool {
24
-	return t.t.Stop()
25
-}