vendorize: update all vendorized packages. (#2206)

Bring in new changes from upstream for all the packages.

Important ones include
   - gorilla/mux
   - logrus
   - jwt
This commit is contained in:
Harshavardhana
2016-07-14 14:59:20 -07:00
committed by GitHub
parent b090c7112e
commit 35d438e0ff
84 changed files with 2546 additions and 1506 deletions

19
vendor/github.com/cheggaaa/pb/pb.go generated vendored
View File

@@ -13,7 +13,7 @@ import (
)
// Current version
const Version = "1.0.2"
const Version = "1.0.4"
const (
// Default refresh rate - 200ms
@@ -81,6 +81,7 @@ type ProgressBar struct {
Width int
ForceWidth bool
ManualUpdate bool
AutoStat bool
// Default width for the time box.
UnitsWidth int
@@ -115,6 +116,7 @@ func (pb *ProgressBar) Start() *ProgressBar {
if pb.Total == 0 {
pb.ShowTimeLeft = false
pb.ShowPercent = false
pb.AutoStat = false
}
if !pb.ManualUpdate {
pb.Update() // Initial printing of the bar before running the bar refresher.
@@ -128,6 +130,12 @@ func (pb *ProgressBar) Increment() int {
return pb.Add(1)
}
// Get current value
func (pb *ProgressBar) Get() int64 {
c := atomic.LoadInt64(&pb.current)
return c
}
// Set current value
func (pb *ProgressBar) Set(current int) *ProgressBar {
return pb.Set64(int64(current))
@@ -242,6 +250,7 @@ func (pb *ProgressBar) Read(p []byte) (n int, err error) {
}
// Create new proxy reader over bar
// Takes io.Reader or io.ReadCloser
func (pb *ProgressBar) NewProxyReader(r io.Reader) *Reader {
return &Reader{r, pb}
}
@@ -398,6 +407,14 @@ func (pb *ProgressBar) Update() {
pb.write(c)
pb.currentValue = c
}
if pb.AutoStat {
if c == 0 {
pb.startTime = time.Now()
pb.startValue = 0
} else if c >= pb.Total && pb.isFinish != true {
pb.Finish()
}
}
}
func (pb *ProgressBar) String() string {

View File

@@ -15,3 +15,11 @@ func (r *Reader) Read(p []byte) (n int, err error) {
r.bar.Add(n)
return
}
// Close the reader when it implements io.Closer
func (r *Reader) Close() (err error) {
if closer, ok := r.Reader.(io.Closer); ok {
return closer.Close()
}
return
}