2019-04-22 02:59:20 +00:00

23 lines
315 B
Go

package rate
import (
"context"
)
// Op operations type.
type Op int
const (
// Success opertion type: success
Success Op = iota
// Ignore opertion type: ignore
Ignore
// Drop opertion type: drop
Drop
)
// Limiter limit interface.
type Limiter interface {
Allow(ctx context.Context) (func(Op), error)
}