rule

package
v1.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompoundRule

type CompoundRule struct{}

type IpRateLimiter

type IpRateLimiter struct {
	// contains filtered or unexported fields
}

func NewIpRateLimiter

func NewIpRateLimiter(r rate.Limit, b int) *IpRateLimiter

NewIpRateLimiter .

func (*IpRateLimiter) AddIP

func (i *IpRateLimiter) AddIP(ip string) *rate.Limiter

AddIP creates a new rate limiter and adds it to the ips map, using the IP address as the key

func (*IpRateLimiter) GetLimiter

func (i *IpRateLimiter) GetLimiter(ip string) *rate.Limiter

GetLimiter returns the rate limiter for the provided IP address if it exists. Otherwise, calls AddIP to add IP address to the map

type IpRateRule

type IpRateRule struct {
	// contains filtered or unexported fields
}

type IpRule

type IpRule struct{}

type Rule

type Rule interface {
	// contains filtered or unexported methods
}

type RuleResult

type RuleResult struct {
	Action     string
	StatusCode int
	Reason     string
}

func CheckRules

func CheckRules(ruleIds []string, r *http.Request) (*RuleResult, error)

type UaRule

type UaRule struct{}

type WafRule

type WafRule struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL