limit_count_redis

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Name = "limitCountRedis"
)

Variables

View Source
var File_types_plugins_limit_count_redis_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) Descriptor() ([]byte, []int)

Deprecated: Use Cluster.ProtoReflect.Descriptor instead.

func (*Cluster) GetAddresses

func (x *Cluster) GetAddresses() []string

func (*Cluster) ProtoMessage

func (*Cluster) ProtoMessage()

func (*Cluster) ProtoReflect

func (x *Cluster) ProtoReflect() protoreflect.Message

func (*Cluster) Reset

func (x *Cluster) Reset()

func (*Cluster) String

func (x *Cluster) String() string

func (*Cluster) Validate

func (m *Cluster) Validate() error

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

func (m *Cluster) ValidateAll() error

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 */
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAddress

func (x *Config) GetAddress() string

func (*Config) GetCluster

func (x *Config) GetCluster() *Cluster

func (*Config) GetEnableLimitQuotaHeaders

func (x *Config) GetEnableLimitQuotaHeaders() bool

func (*Config) GetFailureModeDeny

func (x *Config) GetFailureModeDeny() bool

func (*Config) GetPassword

func (x *Config) GetPassword() string

func (*Config) GetRateLimitedStatus

func (x *Config) GetRateLimitedStatus() v1.StatusCode

func (*Config) GetRules

func (x *Config) GetRules() []*Rule

func (*Config) GetSource

func (m *Config) GetSource() isConfig_Source

func (*Config) GetStatusOnError

func (x *Config) GetStatusOnError() v1.StatusCode

func (*Config) GetTls

func (x *Config) GetTls() bool

func (*Config) GetTlsSkipVerify

func (x *Config) GetTlsSkipVerify() bool

func (*Config) GetUsername

func (x *Config) GetUsername() string

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) Validate

func (m *Config) Validate() error

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

func (m *Config) ValidateAll() error

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) Descriptor() ([]byte, []int)

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) GetCount

func (x *Rule) GetCount() uint32

func (*Rule) GetKey

func (x *Rule) GetKey() string

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) Reset

func (x *Rule) Reset()

func (*Rule) String

func (x *Rule) String() string

func (*Rule) Validate

func (m *Rule) Validate() error

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

func (m *Rule) ValidateAll() error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL