Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.55.0
type Config struct {
Name string `fig:"name"`
MaxSessions int `fig:"max_sessions" default:"10"`
Rate struct {
Limit int `fig:"limit" default:"1000"`
Burst int `fig:"burst" default:"0"`
} `fig:"rate"`
Matching struct {
JID struct {
In []string `fig:"in"`
RegEx string `fig:"regex"`
}
} `fig:"matching"`
}
Config contains Shaper configuration parameters.
type Shaper ¶
type Shaper struct {
// Name is the shaper name.
Name string
// MaxSessions represents maximum sessions count.
MaxSessions int
// contains filtered or unexported fields
}
Shaper represents a connection traffic constraint set.
func (*Shaper) RateLimiter ¶
RateLimiter returns a new rate limiter configured with shaper parameters.
type Shapers ¶
type Shapers []Shaper
Shapers represents a shaper collection ordered by priority.
func (Shapers) DefaultC2S ¶
DefaultC2S returns C2S default shaper.
func (Shapers) DefaultS2S ¶
DefaultS2S returns S2S default shaper.
Click to show internal directories.
Click to hide internal directories.