# README
ratelimit
import "github.com/ccheers/xpkg/ratelimit"
Index
type Allow
Allow allow options.
type Allow struct{}
func DefaultAllowOpts
func DefaultAllowOpts() Allow
DefaultAllowOpts returns the default allow options.
type AllowOption
AllowOption some option of Allow
type AllowOption interface {
Apply(*Allow)
}
type DoneInfo
DoneInfo done info.
type DoneInfo struct {
Err error
Op Op
}
type Limiter
Limiter limit interface.
type Limiter interface {
Allow(ctx context.Context, opts ...AllowOption) (func(info DoneInfo), error)
}
type Op
Op operations type.
type Op int
const (
// Success opertion type: success
Success Op = iota
// Ignore opertion type: ignore
Ignore
// Drop opertion type: drop
Drop
)
Generated by gomarkdoc
# Packages
No description provided by the author
# Functions
DefaultAllowOpts returns the default allow options.
# Type aliases
Op operations type.