github.com/larrabee/ratelimit@v1.0.6-0.20191102113931-712217ec4fdc/bucket.go (about)

     1  package ratelimit
     2  
     3  import "time"
     4  
     5  type Bucket interface {
     6  	Wait(count int64)
     7  	WaitMaxDuration(count int64, maxWait time.Duration) bool
     8  	Take(count int64) time.Duration
     9  	TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool)
    10  	TakeAvailable(count int64) int64
    11  	Available() int64
    12  	Capacity() int64
    13  	Rate() float64
    14  }