Documentation ¶
Index ¶
- Constants
- Variables
- type Cluster
- func (*Cluster) Descriptor() ([]byte, []int)deprecated
- func (x *Cluster) GetAddresses() []string
- func (*Cluster) ProtoMessage()
- func (x *Cluster) ProtoReflect() protoreflect.Message
- func (x *Cluster) Reset()
- func (x *Cluster) String() string
- func (m *Cluster) Validate() error
- func (m *Cluster) ValidateAll() error
- type ClusterMultiError
- type ClusterValidationError
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetAddress() string
- func (x *Config) GetCluster() *Cluster
- func (x *Config) GetEnableLimitQuotaHeaders() bool
- func (x *Config) GetFailureModeDeny() bool
- func (x *Config) GetPassword() string
- func (x *Config) GetPrefix() string
- func (x *Config) GetRateLimitedStatus() v1.StatusCode
- func (x *Config) GetRules() []*Rule
- func (m *Config) GetSource() isConfig_Source
- func (x *Config) GetStatusOnError() v1.StatusCode
- func (x *Config) GetTls() bool
- func (x *Config) GetTlsSkipVerify() bool
- func (x *Config) GetUsername() string
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- func (m *Config) Validate() error
- func (m *Config) ValidateAll() error
- type ConfigMultiError
- type ConfigValidationError
- type Config_Address
- type Config_Cluster
- type CustomConfig
- type Plugin
- type Rule
- func (*Rule) Descriptor() ([]byte, []int)deprecated
- func (x *Rule) GetCount() uint32
- func (x *Rule) GetKey() string
- func (x *Rule) GetTimeWindow() *durationpb.Duration
- func (*Rule) ProtoMessage()
- func (x *Rule) ProtoReflect() protoreflect.Message
- func (x *Rule) Reset()
- func (x *Rule) String() string
- func (m *Rule) Validate() error
- func (m *Rule) ValidateAll() error
- type RuleMultiError
- type RuleValidationError
Constants ¶
const (
Name = "limitCountRedis"
)
Variables ¶
var File_types_plugins_limitcountredis_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` // contains filtered or unexported fields }
func (*Cluster) Descriptor
deprecated
func (*Cluster) GetAddresses ¶
func (*Cluster) ProtoMessage ¶
func (*Cluster) ProtoMessage()
func (*Cluster) ProtoReflect ¶
func (x *Cluster) ProtoReflect() protoreflect.Message
func (*Cluster) Validate ¶
Validate checks the field values on Cluster 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 (*Cluster) ValidateAll ¶
ValidateAll checks the field values on Cluster 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 ClusterMultiError, or nil if none found.
type ClusterMultiError ¶
type ClusterMultiError []error
ClusterMultiError is an error wrapping multiple validation errors returned by Cluster.ValidateAll() if the designated constraints aren't met.
func (ClusterMultiError) AllErrors ¶
func (m ClusterMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ClusterMultiError) Error ¶
func (m ClusterMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ClusterValidationError ¶
type ClusterValidationError struct {
// contains filtered or unexported fields
}
ClusterValidationError is the validation error returned by Cluster.Validate if the designated constraints aren't met.
func (ClusterValidationError) Cause ¶
func (e ClusterValidationError) Cause() error
Cause function returns cause value.
func (ClusterValidationError) Error ¶
func (e ClusterValidationError) Error() string
Error satisfies the builtin error interface
func (ClusterValidationError) ErrorName ¶
func (e ClusterValidationError) ErrorName() string
ErrorName returns error name.
func (ClusterValidationError) Field ¶
func (e ClusterValidationError) Field() string
Field function returns field value.
func (ClusterValidationError) Key ¶
func (e ClusterValidationError) Key() bool
Key function returns key value.
func (ClusterValidationError) Reason ¶
func (e ClusterValidationError) Reason() string
Reason function returns reason value.
type Config ¶
type Config struct { // Types that are assignable to Source: // // *Config_Address // *Config_Cluster Source isConfig_Source `protobuf_oneof:"source"` // put a max limit as the rules are sent as one lua script Rules []*Rule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"` FailureModeDeny bool `protobuf:"varint,3,opt,name=failure_mode_deny,json=failureModeDeny,proto3" json:"failure_mode_deny,omitempty"` EnableLimitQuotaHeaders bool `` /* 135-byte string literal not displayed */ Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` Tls bool `protobuf:"varint,7,opt,name=tls,proto3" json:"tls,omitempty"` TlsSkipVerify bool `protobuf:"varint,8,opt,name=tls_skip_verify,json=tlsSkipVerify,proto3" json:"tls_skip_verify,omitempty"` StatusOnError v1.StatusCode `` /* 140-byte string literal not displayed */ RateLimitedStatus v1.StatusCode `` /* 153-byte string literal not displayed */ // There is no special reason to limit the length <=128, just to avoid too long string Prefix string `protobuf:"bytes,12,opt,name=prefix,proto3" json:"prefix,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetAddress ¶
func (*Config) GetCluster ¶
func (*Config) GetEnableLimitQuotaHeaders ¶
func (*Config) GetFailureModeDeny ¶
func (*Config) GetPassword ¶
func (*Config) GetRateLimitedStatus ¶
func (x *Config) GetRateLimitedStatus() v1.StatusCode
func (*Config) GetStatusOnError ¶
func (x *Config) GetStatusOnError() v1.StatusCode
func (*Config) GetTlsSkipVerify ¶
func (*Config) GetUsername ¶
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 Config_Address ¶
type Config_Address struct {
Address string `protobuf:"bytes,1,opt,name=address,proto3,oneof"`
}
type Config_Cluster ¶
type Config_Cluster struct {
Cluster *Cluster `protobuf:"bytes,11,opt,name=cluster,proto3,oneof"`
}
type CustomConfig ¶
type CustomConfig struct {
Config
}
func (*CustomConfig) Validate ¶
func (conf *CustomConfig) Validate() error
type Plugin ¶
type Plugin struct {
plugins.PluginMethodDefaultImpl
}
func (*Plugin) Config ¶
func (p *Plugin) Config() api.PluginConfig
func (*Plugin) Order ¶
func (p *Plugin) Order() plugins.PluginOrder
func (*Plugin) Type ¶
func (p *Plugin) Type() plugins.PluginType
type Rule ¶
type Rule struct { TimeWindow *durationpb.Duration `protobuf:"bytes,1,opt,name=time_window,json=timeWindow,proto3" json:"time_window,omitempty"` Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
func (*Rule) Descriptor
deprecated
func (*Rule) GetTimeWindow ¶
func (x *Rule) GetTimeWindow() *durationpb.Duration
func (*Rule) ProtoMessage ¶
func (*Rule) ProtoMessage()
func (*Rule) ProtoReflect ¶
func (x *Rule) ProtoReflect() protoreflect.Message
func (*Rule) Validate ¶
Validate checks the field values on Rule 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 (*Rule) ValidateAll ¶
ValidateAll checks the field values on Rule 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 RuleMultiError, or nil if none found.
type RuleMultiError ¶
type RuleMultiError []error
RuleMultiError is an error wrapping multiple validation errors returned by Rule.ValidateAll() if the designated constraints aren't met.
func (RuleMultiError) AllErrors ¶
func (m RuleMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RuleMultiError) Error ¶
func (m RuleMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RuleValidationError ¶
type RuleValidationError struct {
// contains filtered or unexported fields
}
RuleValidationError is the validation error returned by Rule.Validate if the designated constraints aren't met.
func (RuleValidationError) Cause ¶
func (e RuleValidationError) Cause() error
Cause function returns cause value.
func (RuleValidationError) Error ¶
func (e RuleValidationError) Error() string
Error satisfies the builtin error interface
func (RuleValidationError) ErrorName ¶
func (e RuleValidationError) ErrorName() string
ErrorName returns error name.
func (RuleValidationError) Field ¶
func (e RuleValidationError) Field() string
Field function returns field value.
func (RuleValidationError) Key ¶
func (e RuleValidationError) Key() bool
Key function returns key value.
func (RuleValidationError) Reason ¶
func (e RuleValidationError) Reason() string
Reason function returns reason value.