Documentation ¶
Index ¶
- Variables
- func ComparePluginOrder(a, b string) bool
- func ComparePluginOrderInt(a, b string) int
- func IterateHttpPlugin(f func(key string, value Plugin) bool)
- func RegisterHttpFilterFactoryAndParser(name string, factory api.FilterFactory, parser FilterConfigParser)
- func RegisterHttpPlugin(name string, plugin Plugin)
- type Config
- type ConfigMultiError
- type ConfigValidationError
- type ConsumerPlugin
- type FilterConfigParser
- type FilterFactoryAndParser
- type GoPlugin
- type Initer
- type MockPlugin
- type MockPluginConfig
- type NativePlugin
- type NativePluginHasRouteConfigWrapper
- type Plugin
- type PluginConfigParser
- type PluginMethodDefaultImpl
- type PluginOrder
- type PluginOrderOperation
- type PluginOrderPosition
- type PluginType
Constants ¶
This section is empty.
Variables ¶
var File_pkg_plugins_config_proto protoreflect.FileDescriptor
Functions ¶
func ComparePluginOrder ¶
func ComparePluginOrderInt ¶
func IterateHttpPlugin ¶
func RegisterHttpFilterFactoryAndParser ¶
func RegisterHttpFilterFactoryAndParser(name string, factory api.FilterFactory, parser FilterConfigParser)
func RegisterHttpPlugin ¶
Types ¶
type Config ¶
type Config struct { Pet string `protobuf:"bytes,1,opt,name=pet,proto3" json:"pet,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) Validate ¶
Validate checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Config) ValidateAll ¶
ValidateAll checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfigMultiError, or nil if none found.
type ConfigMultiError ¶
type ConfigMultiError []error
ConfigMultiError is an error wrapping multiple validation errors returned by Config.ValidateAll() if the designated constraints aren't met.
func (ConfigMultiError) AllErrors ¶
func (m ConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfigMultiError) Error ¶
func (m ConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfigValidationError ¶
type ConfigValidationError struct {
// contains filtered or unexported fields
}
ConfigValidationError is the validation error returned by Config.Validate if the designated constraints aren't met.
func (ConfigValidationError) Cause ¶
func (e ConfigValidationError) Cause() error
Cause function returns cause value.
func (ConfigValidationError) Error ¶
func (e ConfigValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigValidationError) ErrorName ¶
func (e ConfigValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigValidationError) Field ¶
func (e ConfigValidationError) Field() string
Field function returns field value.
func (ConfigValidationError) Key ¶
func (e ConfigValidationError) Key() bool
Key function returns key value.
func (ConfigValidationError) Reason ¶
func (e ConfigValidationError) Reason() string
Reason function returns reason value.
type ConsumerPlugin ¶
type ConsumerPlugin interface { Plugin ConsumerConfig() api.PluginConsumerConfig }
type FilterConfigParser ¶
type FilterConfigParser interface { Parse(input interface{}, callbacks api.ConfigCallbackHandler) (interface{}, error) Merge(parentConfig interface{}, childConfig interface{}) interface{} }
Here we introduce extra struct to avoid cyclic import between pkg/filtermanager and pkg/plugins
type FilterFactoryAndParser ¶
type FilterFactoryAndParser struct { ConfigParser FilterConfigParser Factory api.FilterFactory }
func LoadHttpFilterFactoryAndParser ¶
func LoadHttpFilterFactoryAndParser(name string) *FilterFactoryAndParser
type GoPlugin ¶
type GoPlugin interface { Plugin Factory() api.FilterFactory }
type Initer ¶
type Initer interface {
Init(cb api.ConfigCallbackHandler) error
}
type MockPlugin ¶
type MockPlugin struct {
PluginMethodDefaultImpl
}
func (*MockPlugin) Config ¶
func (m *MockPlugin) Config() api.PluginConfig
func (*MockPlugin) Factory ¶
func (m *MockPlugin) Factory() api.FilterFactory
func (*MockPlugin) Merge ¶
func (m *MockPlugin) Merge(parent interface{}, child interface{}) interface{}
type MockPluginConfig ¶
type MockPluginConfig struct {
Config
}
type NativePlugin ¶
type NativePluginHasRouteConfigWrapper ¶
type NativePluginHasRouteConfigWrapper interface { // ToRouteConfig converts the raw config to the real RouteConfig. It's used in some native plugin // for better user experience. // The input `raw` is the configuration user provides in the CRD, the returned value is the // configuration that will be delivered in the xDS. ToRouteConfig(raw map[string]interface{}) map[string]interface{} }
type Plugin ¶
type Plugin interface { Config() api.PluginConfig // Optional methods Type() PluginType Order() PluginOrder Merge(parent interface{}, child interface{}) interface{} }
func LoadHttpPlugin ¶
type PluginConfigParser ¶
type PluginConfigParser struct {
GoPlugin
}
func NewPluginConfigParser ¶
func NewPluginConfigParser(parser GoPlugin) *PluginConfigParser
func (*PluginConfigParser) Parse ¶
func (cp *PluginConfigParser) Parse(any interface{}, callbacks api.ConfigCallbackHandler) (interface{}, error)
type PluginMethodDefaultImpl ¶
type PluginMethodDefaultImpl struct{}
PluginMethodDefaultImpl provides reasonable implementation for optional methods
func (*PluginMethodDefaultImpl) Merge ¶
func (p *PluginMethodDefaultImpl) Merge(parent interface{}, child interface{}) interface{}
func (*PluginMethodDefaultImpl) Order ¶
func (p *PluginMethodDefaultImpl) Order() PluginOrder
func (*PluginMethodDefaultImpl) Type ¶
func (p *PluginMethodDefaultImpl) Type() PluginType
type PluginOrder ¶
type PluginOrder struct { Position PluginOrderPosition Operation PluginOrderOperation }
type PluginOrderOperation ¶
type PluginOrderOperation int
const ( OrderOperationInsertFirst PluginOrderOperation = -1 OrderOperationNop PluginOrderOperation = 0 // Nop is the default OrderOperationInsertLast PluginOrderOperation = 1 )
If InsertFirst is specified, the plugin will be ordered from the beginning of the group. InsertLast is the opposite.
type PluginOrderPosition ¶
type PluginOrderPosition int
const ( OrderPositionOuter PluginOrderPosition = iota // First position. It's reserved for Native plugins. // Now goes the Go plugins OrderPositionAccess OrderPositionAuthn OrderPositionAuthz OrderPositionTraffic OrderPositionTransform OrderPositionUnspecified OrderPositionBeforeUpstream // Stats plugins are expected to be called mainly in the Log phase OrderPositionStats // Last position. It's reserved for Native plugins. OrderPositionInner )
type PluginType ¶
type PluginType int
const ( TypeSecurity PluginType = iota // Plugins like WAF, request validation, etc. TypeAuthn // Plugins do authentication TypeAuthz // Plugins do authorization TypeTraffic // Plugins do traffic control, like rate limit, circuit breaker, etc. TypeTransform // Plugins do request/response transform TypeObservability // Plugins do observability TypeGeneral )