Documentation ¶
Index ¶
Constants ¶
View Source
const (
Version string = "1.0.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
func InfLimiter ¶ added in v1.0.0
func InfLimiter() *Limiter
func NewLimiter ¶
func NewLimiter(limit int, funcs ...PriorityFunc) *Limiter
func (*Limiter) Reserve ¶
func (lim *Limiter) Reserve(lv Level) *Reservation
type PriorityFunc ¶
func Priority ¶
func Priority(p Level, rate float64) PriorityFunc
type Reservation ¶
type Reservation struct {
// contains filtered or unexported fields
}
func (*Reservation) Cancel ¶
func (r *Reservation) Cancel()
func (*Reservation) CancelAt ¶
func (r *Reservation) CancelAt(now time.Time)
func (*Reservation) Delay ¶
func (r *Reservation) Delay() time.Duration
func (*Reservation) OK ¶
func (r *Reservation) OK() bool
Click to show internal directories.
Click to hide internal directories.