Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeAbort = "abort" TypeDelay = "delay" TriggerTypeRandom = "random" TriggerTypeAlways = "always" TriggerTypePercentage = "percentage" )
View Source
const (
Kind = constant.HTTPFailInjectFilter
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func (Filter) Decode ¶
func (f Filter) Decode(ctx *contextHttp.HttpContext) filter.FilterStatus
type FilterFactory ¶
type FilterFactory struct {
// contains filtered or unexported fields
}
func (*FilterFactory) Apply ¶
func (factory *FilterFactory) Apply() error
func (*FilterFactory) Config ¶
func (factory *FilterFactory) Config() any
func (*FilterFactory) PrepareFilterChain ¶
func (factory *FilterFactory) PrepareFilterChain(ctx *contextHttp.HttpContext, chain filter.FilterChain) error
type Plugin ¶
type Plugin struct {
}
func (*Plugin) CreateFilterFactory ¶
func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error)
type Rule ¶
type Rule struct {
StatusCode int `yaml:"status_code" json:"status_code"`
Body string `yaml:"body" json:"body"`
Type string `yaml:"type" json:"type"` // abort, delay
TriggerType string `yaml:"trigger_type" json:"trigger_type"` // random, always, percentage
Odds int `yaml:"odds" json:"odds"` // 0-100
Delay time.Duration `yaml:"delay" json:"delay"`
}
Click to show internal directories.
Click to hide internal directories.