Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

22
library/rate/rate.go Normal file
View File

@@ -0,0 +1,22 @@
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)
}