Documentation ¶
Index ¶
- func New(allowed uint64, overflow ...func(c *znet.Context)) znet.HandlerFunc
- type Rule
- func (r *Rule) AddRule(exp time.Duration, allowed int, estimated ...int)
- func (r *Rule) AllowVisit(keys ...interface{}) bool
- func (r *Rule) AllowVisitByIP(ip string) bool
- func (r *Rule) GetOnline() []string
- func (r *Rule) Remaining(key interface{}) []int
- func (r *Rule) RemainingVisitsByIP(ip string) []int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rule ¶ added in v1.1.17
type Rule struct {
// contains filtered or unexported fields
}
Rule user access control strategy
func (*Rule) AddRule ¶ added in v1.1.17
AddRule increase user access control strategy If less than 1s, please use golang.org/x/time/rate
func (*Rule) AllowVisit ¶ added in v1.1.17
AllowVisit Is access allowed
func (*Rule) AllowVisitByIP ¶ added in v1.1.17
AllowVisitByIP AllowVisit IP
func (*Rule) RemainingVisitsByIP ¶ added in v1.1.17
RemainingVisitsByIP Remaining Visits IP
Click to show internal directories.
Click to hide internal directories.