Documentation
¶
Index ¶
Constants ¶
View Source
const (
Kind = constant.HTTPAuthorityFilter
)
Variables ¶
View Source
var ( // StrategyTypeName key int32 for StrategyType, value string StrategyTypeName = map[int32]string{ 0: "Whitelist", 1: "Blacklist", } // StrategyTypeValue key string, value int32 for StrategyType StrategyTypeValue = map[string]int32{ "Whitelist": 0, "Blacklist": 1, } // LimitTypeName key int32 for LimitType, value string LimitTypeName = map[int32]string{ 0: "IP", 1: "App", } // LimitTypeValue key string, value int32 for LimitType LimitTypeValue = map[string]int32{ "IP": 0, "App": 1, } )
Functions ¶
This section is empty.
Types ¶
type AuthorityConfiguration ¶ added in v1.1.0
type AuthorityConfiguration struct {
Rules []AuthorityRule `yaml:"authority_rules" json:"authority_rules"` // Rules the authority rule list
}
AuthorityConfiguration blacklist/whitelist config
func (*AuthorityConfiguration) DeepCopy ¶ added in v1.1.0
func (ac *AuthorityConfiguration) DeepCopy() *AuthorityConfiguration
DeepCopy returns a new independent copy of Config Deep copy slices/maps to avoid sharing pointers with the factory
type AuthorityRule ¶ added in v1.1.0
type AuthorityRule struct {
Strategy StrategyType `yaml:"strategy" json:"strategy"` // Strategy the authority rule strategy
Limit LimitType `yaml:"limit" json:"limit"` // Limit the authority rule limit
Items []string `yaml:"items" json:"items"` // Items the authority rule items
}
AuthorityRule blacklist/whitelist rule
func (*AuthorityRule) DeepCopy ¶ added in v1.1.0
func (rule *AuthorityRule) DeepCopy() *AuthorityRule
DeepCopy returns a new independent copy of Config Deep copy slices/maps to avoid sharing pointers with the factory
type Filter ¶ added in v1.1.0
type Filter struct {
// contains filtered or unexported fields
}
func (*Filter) Decode ¶ added in v1.1.0
func (f *Filter) Decode(c *http.HttpContext) filter.FilterStatus
type FilterFactory ¶ added in v1.1.0
type FilterFactory struct {
// contains filtered or unexported fields
}
FilterFactory is http filter instance
func (*FilterFactory) Apply ¶ added in v1.1.0
func (factory *FilterFactory) Apply() error
func (*FilterFactory) Config ¶ added in v1.1.0
func (factory *FilterFactory) Config() any
func (*FilterFactory) PrepareFilterChain ¶ added in v1.1.0
func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain filter.FilterChain) error
type Plugin ¶ added in v1.1.0
type Plugin struct {
}
AuthorityPlugin is http filter plugin.
func (*Plugin) CreateFilterFactory ¶ added in v1.1.0
func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error)
type StrategyType ¶ added in v1.1.0
type StrategyType int32
StrategyType the authority rule strategy enum
const ( Whitelist StrategyType = 0 Blacklist StrategyType = 1 )
StrategyType strategy type const
Click to show internal directories.
Click to hide internal directories.