diff options
author | Huabing Zhao <zhaohuabing@gmail.com> | 2018-06-29 13:49:52 +0800 |
---|---|---|
committer | Huabing Zhao <zhaohuabing@gmail.com> | 2018-07-02 09:10:04 +0000 |
commit | 370c3f5400a115255fe27a674e325c88187f5dfd (patch) | |
tree | 99aacc73fb60031f40ffce14fa3828470f1a2395 /src/kube2msb/vendor/golang.org/x/time/rate/rate_go16.go | |
parent | 9ddcc8470c7ed6a2cbddfb079b6396bb58436827 (diff) |
Remove juju/ratelimit to avoid LGPL issuebeijing
Change-Id: I1bf246a713d07fc9891f23ea85fb40c7864f05ef
Issue-ID: OOM-1271
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Diffstat (limited to 'src/kube2msb/vendor/golang.org/x/time/rate/rate_go16.go')
-rw-r--r-- | src/kube2msb/vendor/golang.org/x/time/rate/rate_go16.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/kube2msb/vendor/golang.org/x/time/rate/rate_go16.go b/src/kube2msb/vendor/golang.org/x/time/rate/rate_go16.go new file mode 100644 index 0000000..6bab185 --- /dev/null +++ b/src/kube2msb/vendor/golang.org/x/time/rate/rate_go16.go @@ -0,0 +1,21 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package rate + +import "golang.org/x/net/context" + +// Wait is shorthand for WaitN(ctx, 1). +func (lim *Limiter) Wait(ctx context.Context) (err error) { + return lim.waitN(ctx, 1) +} + +// WaitN blocks until lim permits n events to happen. +// It returns an error if n exceeds the Limiter's burst size, the Context is +// canceled, or the expected wait time exceeds the Context's Deadline. +func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { + return lim.waitN(ctx, n) +} |