Documentation ¶
Index ¶
- Constants
- Variables
- func NewActuator() *actuatorHttp
- func Register(register eosc.IExtenderDriverRegister)
- func RegisterActuator(handler ActuatorsHandler)
- type ActuatorSet
- type ActuatorsHandler
- type Config
- type Controller
- func (c *Controller) AllWorkers() []string
- func (c *Controller) Check(cfg interface{}) (profession, name, driver, desc string, err error)
- func (c *Controller) ConfigType() reflect.Type
- func (c *Controller) Del(id string)
- func (c *Controller) Get() interface{}
- func (c *Controller) Mode() eosc.SettingMode
- func (c *Controller) Set(conf interface{}) (err error)
- func (c *Controller) Store(id string)
- type IController
- type Limiting
- type LimitingHandler
- func (l *LimitingHandler) Filter() strategy.IFilter
- func (l *LimitingHandler) Metrics() metrics.Metrics
- func (l *LimitingHandler) Name() string
- func (l *LimitingHandler) Priority() int
- func (l *LimitingHandler) Query() ThresholdUint
- func (l *LimitingHandler) Stop() bool
- func (l *LimitingHandler) Traffic() ThresholdUint
- type Rule
- type Set
- type Threshold
- type ThresholdUint
Constants ¶
View Source
const Name = "strategy-limiting"
Variables ¶
View Source
var (
ErrorLimitingRefuse = errors.New("refuse by limiting strategy")
)
Functions ¶
func NewActuator ¶
func NewActuator() *actuatorHttp
func RegisterActuator ¶
func RegisterActuator(handler ActuatorsHandler)
Types ¶
type ActuatorSet ¶
type ActuatorSet interface { Set(id string, limiting *LimitingHandler) Del(id string) }
type ActuatorsHandler ¶
type Config ¶
type Config struct { Name string `json:"name" skip:"skip"` Description string `json:"description" skip:"skip"` Stop bool `json:"stop"` Priority int `json:"priority" label:"优先级" description:"1-999"` Filters strategy.FilterConfig `json:"filters" label:"过滤规则"` Rule Rule `json:"limiting" label:"限流规则" description:"限流规则"` }
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController() *Controller
func (*Controller) AllWorkers ¶
func (c *Controller) AllWorkers() []string
func (*Controller) Check ¶
func (c *Controller) Check(cfg interface{}) (profession, name, driver, desc string, err error)
func (*Controller) ConfigType ¶
func (c *Controller) ConfigType() reflect.Type
func (*Controller) Del ¶
func (c *Controller) Del(id string)
func (*Controller) Get ¶
func (c *Controller) Get() interface{}
func (*Controller) Mode ¶
func (c *Controller) Mode() eosc.SettingMode
func (*Controller) Set ¶
func (c *Controller) Set(conf interface{}) (err error)
func (*Controller) Store ¶
func (c *Controller) Store(id string)
type IController ¶
type Limiting ¶
type Limiting struct {
// contains filtered or unexported fields
}
func (*Limiting) CheckSkill ¶
type LimitingHandler ¶
type LimitingHandler struct {
// contains filtered or unexported fields
}
func NewLimitingHandler ¶
func NewLimitingHandler(conf *Config) (*LimitingHandler, error)
func (*LimitingHandler) Filter ¶
func (l *LimitingHandler) Filter() strategy.IFilter
func (*LimitingHandler) Metrics ¶
func (l *LimitingHandler) Metrics() metrics.Metrics
func (*LimitingHandler) Name ¶
func (l *LimitingHandler) Name() string
func (*LimitingHandler) Priority ¶
func (l *LimitingHandler) Priority() int
func (*LimitingHandler) Query ¶
func (l *LimitingHandler) Query() ThresholdUint
func (*LimitingHandler) Stop ¶
func (l *LimitingHandler) Stop() bool
func (*LimitingHandler) Traffic ¶
func (l *LimitingHandler) Traffic() ThresholdUint
type ThresholdUint ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.