Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedRateLimiter ¶
type FixedRateLimiter struct {
runner.Runner
*FixedRateLimiterCfg
// contains filtered or unexported fields
}
func NewFixedRateLimiter ¶
func NewFixedRateLimiter() *FixedRateLimiter
func (*FixedRateLimiter) Init ¶
func (frl *FixedRateLimiter) Init() error
type FixedRateLimiterCfg ¶
type FixedRateLimiterCfg struct {
N int
}
func NewFixedRateLimiterCfg ¶
func NewFixedRateLimiterCfg() *FixedRateLimiterCfg
type HostRateLimiter ¶
type HostRateLimiter struct {
runner.Runner
*HostRateLimiterCfg
// contains filtered or unexported fields
}
func NewHostRateLimiter ¶
func NewHostRateLimiter() *HostRateLimiter
func (*HostRateLimiter) Init ¶
func (h *HostRateLimiter) Init() error
type HostRateLimiterCfg ¶
type HostRateLimiterCfg struct {
Nic string `json:"nic" validate:"required" yaml:"nic"`
MonitorInterval int `json:"monitorInterval" yaml:"monitorInterval"`
ReservePercent int `json:"reservePercent" yaml:"reservePercent"`
MinMBps int `json:"minMBps" yaml:"minMBps"`
FixedMBps int `json:"fixedMBps" yaml:"fixedMBps"`
}
func NewHostRateLimiterCfg ¶
func NewHostRateLimiterCfg() *HostRateLimiterCfg
type RateLimiterCfg ¶
type RateLimiterCfg struct {
Cfg interface{} `json:"cfg" yaml:"cfg"`
Type RateLimiterType `json:"type" yaml:"type"`
}
type RateLimiterType ¶
type RateLimiterType string
const RateLimiterTypeFixed RateLimiterType = "fixed"
const RateLimiterTypeHost RateLimiterType = "host"
const RateLimiterTypeSleep RateLimiterType = "sleep"
type RxTxRateLimiter ¶
type SleepRateLimiter ¶
type SleepRateLimiter struct {
runner.Runner
*SleepRateLimiterCfg
}
func NewSleepRateLimiter ¶
func NewSleepRateLimiter() *SleepRateLimiter
func (*SleepRateLimiter) Init ¶
func (srl *SleepRateLimiter) Init() error
type SleepRateLimiterCfg ¶
type SleepRateLimiterCfg struct {
Millisecond int
}
func NewSleepRateLimiterCfg ¶
func NewSleepRateLimiterCfg() *SleepRateLimiterCfg
Click to show internal directories.
Click to hide internal directories.