Documentation ¶
Index ¶
- Variables
- type Settings
- func (*Settings) Descriptor() ([]byte, []int)deprecated
- func (x *Settings) GetBackendType() *wrapperspb.StringValue
- func (x *Settings) GetCacheKeyPrefix() *wrapperspb.StringValue
- func (x *Settings) GetDebugHost() *wrapperspb.StringValue
- func (x *Settings) GetDebugPort() *wrapperspb.UInt32Value
- func (x *Settings) GetExpirationJitterMaxSeconds() *wrapperspb.Int64Value
- func (x *Settings) GetExtraTags() map[string]string
- func (x *Settings) GetGlobalShadownMode() *wrapperspb.BoolValue
- func (x *Settings) GetGrpcHost() *wrapperspb.StringValue
- func (x *Settings) GetGrpcMaxConnectionAge() *durationpb.Duration
- func (x *Settings) GetGrpcMaxConnectionAgeGrace() *durationpb.Duration
- func (x *Settings) GetGrpcPort() *wrapperspb.UInt32Value
- func (x *Settings) GetHeaderRatelimitLimit() *wrapperspb.StringValue
- func (x *Settings) GetHeaderRatelimitRemaining() *wrapperspb.StringValue
- func (x *Settings) GetHeaderRatelimitReset() *wrapperspb.StringValue
- func (x *Settings) GetHost() *wrapperspb.StringValue
- func (x *Settings) GetLocalCacheSizeInBytes() *wrapperspb.UInt32Value
- func (x *Settings) GetLogFormat() *wrapperspb.StringValue
- func (x *Settings) GetLogLevel() *wrapperspb.StringValue
- func (x *Settings) GetMemcacheHostPort() []string
- func (x *Settings) GetMemcacheMaxIdleConns() *wrapperspb.UInt32Value
- func (x *Settings) GetMemcacheSrv() *wrapperspb.StringValue
- func (x *Settings) GetMemcacheSrvRefresh() *durationpb.Duration
- func (x *Settings) GetNearLimitRatio() *wrapperspb.FloatValue
- func (x *Settings) GetPort() *wrapperspb.UInt32Value
- func (x *Settings) GetRateLimitResponseHeadersEnabled() *wrapperspb.BoolValue
- func (x *Settings) GetRedisAuth() *wrapperspb.StringValue
- func (x *Settings) GetRedisHealthCheckActiveConnection() *wrapperspb.BoolValue
- func (x *Settings) GetRedisPerSecond() *wrapperspb.BoolValue
- func (x *Settings) GetRedisPerSecondAuth() *wrapperspb.StringValue
- func (x *Settings) GetRedisPerSecondPipelineLimit() *wrapperspb.UInt32Value
- func (x *Settings) GetRedisPerSecondPipelineWindow() *durationpb.Duration
- func (x *Settings) GetRedisPerSecondPoolSize() *wrapperspb.UInt32Value
- func (x *Settings) GetRedisPerSecondSocketType() *wrapperspb.StringValue
- func (x *Settings) GetRedisPerSecondTls() *wrapperspb.BoolValue
- func (x *Settings) GetRedisPerSecondType() *wrapperspb.StringValue
- func (x *Settings) GetRedisPerSecondUrl() *wrapperspb.StringValue
- func (x *Settings) GetRedisPipelineLimit() *wrapperspb.UInt32Value
- func (x *Settings) GetRedisPipelineWindow() *durationpb.Duration
- func (x *Settings) GetRedisPoolSize() *wrapperspb.UInt32Value
- func (x *Settings) GetRedisSocketType() *wrapperspb.StringValue
- func (x *Settings) GetRedisTls() *wrapperspb.BoolValue
- func (x *Settings) GetRedisType() *wrapperspb.StringValue
- func (x *Settings) GetRedisUrl() *wrapperspb.StringValue
- func (x *Settings) GetRuntimeIgnoreDotFiles() *wrapperspb.BoolValue
- func (x *Settings) GetRuntimePath() *wrapperspb.StringValue
- func (x *Settings) GetRuntimeSubdirectory() *wrapperspb.StringValue
- func (x *Settings) GetRuntimeWatchRoot() *wrapperspb.BoolValue
- func (x *Settings) GetStatsdHost() *wrapperspb.StringValue
- func (x *Settings) GetStatsdPort() *wrapperspb.UInt32Value
- func (x *Settings) GetUseStatsd() *wrapperspb.BoolValue
- func (*Settings) ProtoMessage()
- func (x *Settings) ProtoReflect() protoreflect.Message
- func (x *Settings) Reset()
- func (x *Settings) String() string
- func (m *Settings) Validate() error
- func (m *Settings) ValidateAll() error
- type SettingsMultiError
- type SettingsValidationError
Constants ¶
This section is empty.
Variables ¶
var File_ratelimit_settings_v1_settings_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Settings ¶
type Settings struct { // Default: "0.0.0.0". Host *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` // Default: 8080. Port *wrapperspb.UInt32Value `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"` // Default: "0.0.0.0". GrpcHost *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=grpc_host,json=grpcHost,proto3" json:"grpc_host,omitempty"` // Default: 8081. GrpcPort *wrapperspb.UInt32Value `protobuf:"bytes,4,opt,name=grpc_port,json=grpcPort,proto3" json:"grpc_port,omitempty"` // Default: "0.0.0.0". DebugHost *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=debug_host,json=debugHost,proto3" json:"debug_host,omitempty"` // Default: 6070. DebugPort *wrapperspb.UInt32Value `protobuf:"bytes,6,opt,name=debug_port,json=debugPort,proto3" json:"debug_port,omitempty"` // GrpcMaxConnectionAge is a duration for the maximum amount of time a connection may exist before // it will be closed by sending a GoAway. A random jitter of +/-10% will be added to // MaxConnectionAge to spread out connection storms. // Default: 24h. GrpcMaxConnectionAge *durationpb.Duration `protobuf:"bytes,7,opt,name=grpc_max_connection_age,json=grpcMaxConnectionAge,proto3" json:"grpc_max_connection_age,omitempty"` // GrpcMaxConnectionAgeGrace is an additive period after MaxConnectionAge after which the // connection will be forcibly closed. // Default: 1h. GrpcMaxConnectionAgeGrace *durationpb.Duration `` /* 142-byte string literal not displayed */ // Default: "WARN". LogLevel *wrapperspb.StringValue `protobuf:"bytes,9,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` // Default: "text". LogFormat *wrapperspb.StringValue `protobuf:"bytes,10,opt,name=log_format,json=logFormat,proto3" json:"log_format,omitempty"` // Default: true. UseStatsd *wrapperspb.BoolValue `protobuf:"bytes,11,opt,name=use_statsd,json=useStatsd,proto3" json:"use_statsd,omitempty"` // Default: "localhost". StatsdHost *wrapperspb.StringValue `protobuf:"bytes,12,opt,name=statsd_host,json=statsdHost,proto3" json:"statsd_host,omitempty"` // Default: 8125. StatsdPort *wrapperspb.UInt32Value `protobuf:"bytes,13,opt,name=statsd_port,json=statsdPort,proto3" json:"statsd_port,omitempty"` ExtraTags map[string]string `` /* 177-byte string literal not displayed */ // Default: "/srv/runtime_data/current". RuntimePath *wrapperspb.StringValue `protobuf:"bytes,15,opt,name=runtime_path,json=runtimePath,proto3" json:"runtime_path,omitempty"` RuntimeSubdirectory *wrapperspb.StringValue `protobuf:"bytes,16,opt,name=runtime_subdirectory,json=runtimeSubdirectory,proto3" json:"runtime_subdirectory,omitempty"` // Default: false. RuntimeIgnoreDotFiles *wrapperspb.BoolValue `` /* 129-byte string literal not displayed */ // Default: true. RuntimeWatchRoot *wrapperspb.BoolValue `protobuf:"bytes,18,opt,name=runtime_watch_root,json=runtimeWatchRoot,proto3" json:"runtime_watch_root,omitempty"` // Default: 300. ExpirationJitterMaxSeconds *wrapperspb.Int64Value `` /* 144-byte string literal not displayed */ // Default: 0. LocalCacheSizeInBytes *wrapperspb.UInt32Value `` /* 131-byte string literal not displayed */ // Default: 0.8 NearLimitRatio *wrapperspb.FloatValue `protobuf:"bytes,21,opt,name=near_limit_ratio,json=nearLimitRatio,proto3" json:"near_limit_ratio,omitempty"` CacheKeyPrefix *wrapperspb.StringValue `protobuf:"bytes,22,opt,name=cache_key_prefix,json=cacheKeyPrefix,proto3" json:"cache_key_prefix,omitempty"` // Default: "redis". BackendType *wrapperspb.StringValue `protobuf:"bytes,23,opt,name=backend_type,json=backendType,proto3" json:"backend_type,omitempty"` // Settings for optional returning of custom headers // Default: false. RateLimitResponseHeadersEnabled *wrapperspb.BoolValue `` /* 161-byte string literal not displayed */ // Hold the current limit. // Default: "Ratelimit-Limit". HeaderRatelimitLimit *wrapperspb.StringValue `protobuf:"bytes,25,opt,name=header_ratelimit_limit,json=headerRatelimitLimit,proto3" json:"header_ratelimit_limit,omitempty"` // Hold the remaining count. // Default: "Ratelimit-Remaining". HeaderRatelimitRemaining *wrapperspb.StringValue `` /* 136-byte string literal not displayed */ // Hold the remaining second. // Default: RateLimit-Reset HeaderRatelimitReset *wrapperspb.StringValue `protobuf:"bytes,27,opt,name=header_ratelimit_reset,json=headerRatelimitReset,proto3" json:"header_ratelimit_reset,omitempty"` // Default: "unix". RedisSocketType *wrapperspb.StringValue `protobuf:"bytes,28,opt,name=redis_socket_type,json=redisSocketType,proto3" json:"redis_socket_type,omitempty"` // Default: "SINGLE". RedisType *wrapperspb.StringValue `protobuf:"bytes,29,opt,name=redis_type,json=redisType,proto3" json:"redis_type,omitempty"` // Default: "/var/run/nutcracker/ratelimit.sock". RedisUrl *wrapperspb.StringValue `protobuf:"bytes,30,opt,name=redis_url,json=redisUrl,proto3" json:"redis_url,omitempty"` // Default: 10. RedisPoolSize *wrapperspb.UInt32Value `protobuf:"bytes,31,opt,name=redis_pool_size,json=redisPoolSize,proto3" json:"redis_pool_size,omitempty"` RedisAuth *wrapperspb.StringValue `protobuf:"bytes,32,opt,name=redis_auth,json=redisAuth,proto3" json:"redis_auth,omitempty"` // Default: false. RedisTls *wrapperspb.BoolValue `protobuf:"bytes,33,opt,name=redis_tls,json=redisTls,proto3" json:"redis_tls,omitempty"` // RedisPipelineWindow sets the duration after which internal pipelines will be flushed. // If window is zero then implicit pipelining will be disabled. Radix use 150us for the // default value, see https://github.com/mediocregopher/radix/blob/v3.5.1/pool.go#L278. // Default: 0. RedisPipelineWindow *durationpb.Duration `protobuf:"bytes,34,opt,name=redis_pipeline_window,json=redisPipelineWindow,proto3" json:"redis_pipeline_window,omitempty"` // RedisPipelineLimit sets maximum number of commands that can be pipelined before flushing. // If limit is zero then no limit will be used and pipelines will only be limited by the specified // time window. // Default: 0. RedisPipelineLimit *wrapperspb.UInt32Value `protobuf:"bytes,35,opt,name=redis_pipeline_limit,json=redisPipelineLimit,proto3" json:"redis_pipeline_limit,omitempty"` // Default: false. RedisPerSecond *wrapperspb.BoolValue `protobuf:"bytes,36,opt,name=redis_per_second,json=redisPerSecond,proto3" json:"redis_per_second,omitempty"` // Default: "unix". RedisPerSecondSocketType *wrapperspb.StringValue `` /* 140-byte string literal not displayed */ // Default: "SINGLE". RedisPerSecondType *wrapperspb.StringValue `protobuf:"bytes,38,opt,name=redis_per_second_type,json=redisPerSecondType,proto3" json:"redis_per_second_type,omitempty"` // Default: "/var/run/nutcracker/ratelimitpersecond.sock". RedisPerSecondUrl *wrapperspb.StringValue `protobuf:"bytes,39,opt,name=redis_per_second_url,json=redisPerSecondUrl,proto3" json:"redis_per_second_url,omitempty"` // Default: 10. RedisPerSecondPoolSize *wrapperspb.UInt32Value `` /* 134-byte string literal not displayed */ RedisPerSecondAuth *wrapperspb.StringValue `protobuf:"bytes,41,opt,name=redis_per_second_auth,json=redisPerSecondAuth,proto3" json:"redis_per_second_auth,omitempty"` // Default: false. RedisPerSecondTls *wrapperspb.BoolValue `protobuf:"bytes,42,opt,name=redis_per_second_tls,json=redisPerSecondTls,proto3" json:"redis_per_second_tls,omitempty"` // RedisPerSecondPipelineWindow sets the duration after which internal pipelines will be flushed // for per second redis. See comments of RedisPipelineWindow for details. // Default: 0. RedisPerSecondPipelineWindow *durationpb.Duration `` /* 152-byte string literal not displayed */ // RedisPerSecondPipelineLimit sets maximum number of commands that can be pipelined before // flushing for per second redis. See comments of RedisPipelineLimit for details. // Default: 0. RedisPerSecondPipelineLimit *wrapperspb.UInt32Value `` /* 149-byte string literal not displayed */ // Enable healthcheck to check Redis Connection. If there is no active connection, healthcheck // failed. // Default: false. RedisHealthCheckActiveConnection *wrapperspb.BoolValue `` /* 164-byte string literal not displayed */ MemcacheHostPort []string `protobuf:"bytes,46,rep,name=memcache_host_port,json=memcacheHostPort,proto3" json:"memcache_host_port,omitempty"` // MemcacheMaxIdleConns sets the maximum number of idle TCP connections per memcached node. The // default is 2 as that is the default of the underlying library. This is the maximum number of // connections to memcache kept idle in pool, if a connection is needed but none are idle a new // connection is opened, used and closed and can be left in a time-wait state which can result in // high CPU usage. // Default: 2. MemcacheMaxIdleConns *wrapperspb.UInt32Value `` /* 126-byte string literal not displayed */ MemcacheSrv *wrapperspb.StringValue `protobuf:"bytes,48,opt,name=memcache_srv,json=memcacheSrv,proto3" json:"memcache_srv,omitempty"` // Default: 0. MemcacheSrvRefresh *durationpb.Duration `protobuf:"bytes,49,opt,name=memcache_srv_refresh,json=memcacheSrvRefresh,proto3" json:"memcache_srv_refresh,omitempty"` // Should the ratelimiting be running in Global shadow-mode, ie. never report a ratelimit status, // unless a rate was provided from envoy as an override. // Default: false. GlobalShadownMode *wrapperspb.BoolValue `protobuf:"bytes,50,opt,name=global_shadown_mode,json=globalShadownMode,proto3" json:"global_shadown_mode,omitempty"` // contains filtered or unexported fields }
This is the proto representation of https://github.com/envoyproxy/ratelimit/blob/8d6488ead8618ce49a492858321dae946f2d97bc/src/settings/settings.go. This is manually syncronized. The default values, are provided through: ratelimit/settings.go. TODO(dio): Parse https://github.com/envoyproxy/ratelimit/blob/main/src/settings/settings.go and generate this message (always to sync with main).
func (*Settings) Descriptor
deprecated
func (*Settings) GetBackendType ¶
func (x *Settings) GetBackendType() *wrapperspb.StringValue
func (*Settings) GetCacheKeyPrefix ¶
func (x *Settings) GetCacheKeyPrefix() *wrapperspb.StringValue
func (*Settings) GetDebugHost ¶
func (x *Settings) GetDebugHost() *wrapperspb.StringValue
func (*Settings) GetDebugPort ¶
func (x *Settings) GetDebugPort() *wrapperspb.UInt32Value
func (*Settings) GetExpirationJitterMaxSeconds ¶
func (x *Settings) GetExpirationJitterMaxSeconds() *wrapperspb.Int64Value
func (*Settings) GetExtraTags ¶
func (*Settings) GetGlobalShadownMode ¶
func (x *Settings) GetGlobalShadownMode() *wrapperspb.BoolValue
func (*Settings) GetGrpcHost ¶
func (x *Settings) GetGrpcHost() *wrapperspb.StringValue
func (*Settings) GetGrpcMaxConnectionAge ¶
func (x *Settings) GetGrpcMaxConnectionAge() *durationpb.Duration
func (*Settings) GetGrpcMaxConnectionAgeGrace ¶
func (x *Settings) GetGrpcMaxConnectionAgeGrace() *durationpb.Duration
func (*Settings) GetGrpcPort ¶
func (x *Settings) GetGrpcPort() *wrapperspb.UInt32Value
func (*Settings) GetHeaderRatelimitLimit ¶
func (x *Settings) GetHeaderRatelimitLimit() *wrapperspb.StringValue
func (*Settings) GetHeaderRatelimitRemaining ¶
func (x *Settings) GetHeaderRatelimitRemaining() *wrapperspb.StringValue
func (*Settings) GetHeaderRatelimitReset ¶
func (x *Settings) GetHeaderRatelimitReset() *wrapperspb.StringValue
func (*Settings) GetHost ¶
func (x *Settings) GetHost() *wrapperspb.StringValue
func (*Settings) GetLocalCacheSizeInBytes ¶
func (x *Settings) GetLocalCacheSizeInBytes() *wrapperspb.UInt32Value
func (*Settings) GetLogFormat ¶
func (x *Settings) GetLogFormat() *wrapperspb.StringValue
func (*Settings) GetLogLevel ¶
func (x *Settings) GetLogLevel() *wrapperspb.StringValue
func (*Settings) GetMemcacheHostPort ¶
func (*Settings) GetMemcacheMaxIdleConns ¶
func (x *Settings) GetMemcacheMaxIdleConns() *wrapperspb.UInt32Value
func (*Settings) GetMemcacheSrv ¶
func (x *Settings) GetMemcacheSrv() *wrapperspb.StringValue
func (*Settings) GetMemcacheSrvRefresh ¶
func (x *Settings) GetMemcacheSrvRefresh() *durationpb.Duration
func (*Settings) GetNearLimitRatio ¶
func (x *Settings) GetNearLimitRatio() *wrapperspb.FloatValue
func (*Settings) GetPort ¶
func (x *Settings) GetPort() *wrapperspb.UInt32Value
func (*Settings) GetRateLimitResponseHeadersEnabled ¶
func (x *Settings) GetRateLimitResponseHeadersEnabled() *wrapperspb.BoolValue
func (*Settings) GetRedisAuth ¶
func (x *Settings) GetRedisAuth() *wrapperspb.StringValue
func (*Settings) GetRedisHealthCheckActiveConnection ¶
func (x *Settings) GetRedisHealthCheckActiveConnection() *wrapperspb.BoolValue
func (*Settings) GetRedisPerSecond ¶
func (x *Settings) GetRedisPerSecond() *wrapperspb.BoolValue
func (*Settings) GetRedisPerSecondAuth ¶
func (x *Settings) GetRedisPerSecondAuth() *wrapperspb.StringValue
func (*Settings) GetRedisPerSecondPipelineLimit ¶
func (x *Settings) GetRedisPerSecondPipelineLimit() *wrapperspb.UInt32Value
func (*Settings) GetRedisPerSecondPipelineWindow ¶
func (x *Settings) GetRedisPerSecondPipelineWindow() *durationpb.Duration
func (*Settings) GetRedisPerSecondPoolSize ¶
func (x *Settings) GetRedisPerSecondPoolSize() *wrapperspb.UInt32Value
func (*Settings) GetRedisPerSecondSocketType ¶
func (x *Settings) GetRedisPerSecondSocketType() *wrapperspb.StringValue
func (*Settings) GetRedisPerSecondTls ¶
func (x *Settings) GetRedisPerSecondTls() *wrapperspb.BoolValue
func (*Settings) GetRedisPerSecondType ¶
func (x *Settings) GetRedisPerSecondType() *wrapperspb.StringValue
func (*Settings) GetRedisPerSecondUrl ¶
func (x *Settings) GetRedisPerSecondUrl() *wrapperspb.StringValue
func (*Settings) GetRedisPipelineLimit ¶
func (x *Settings) GetRedisPipelineLimit() *wrapperspb.UInt32Value
func (*Settings) GetRedisPipelineWindow ¶
func (x *Settings) GetRedisPipelineWindow() *durationpb.Duration
func (*Settings) GetRedisPoolSize ¶
func (x *Settings) GetRedisPoolSize() *wrapperspb.UInt32Value
func (*Settings) GetRedisSocketType ¶
func (x *Settings) GetRedisSocketType() *wrapperspb.StringValue
func (*Settings) GetRedisTls ¶
func (x *Settings) GetRedisTls() *wrapperspb.BoolValue
func (*Settings) GetRedisType ¶
func (x *Settings) GetRedisType() *wrapperspb.StringValue
func (*Settings) GetRedisUrl ¶
func (x *Settings) GetRedisUrl() *wrapperspb.StringValue
func (*Settings) GetRuntimeIgnoreDotFiles ¶
func (x *Settings) GetRuntimeIgnoreDotFiles() *wrapperspb.BoolValue
func (*Settings) GetRuntimePath ¶
func (x *Settings) GetRuntimePath() *wrapperspb.StringValue
func (*Settings) GetRuntimeSubdirectory ¶
func (x *Settings) GetRuntimeSubdirectory() *wrapperspb.StringValue
func (*Settings) GetRuntimeWatchRoot ¶
func (x *Settings) GetRuntimeWatchRoot() *wrapperspb.BoolValue
func (*Settings) GetStatsdHost ¶
func (x *Settings) GetStatsdHost() *wrapperspb.StringValue
func (*Settings) GetStatsdPort ¶
func (x *Settings) GetStatsdPort() *wrapperspb.UInt32Value
func (*Settings) GetUseStatsd ¶
func (x *Settings) GetUseStatsd() *wrapperspb.BoolValue
func (*Settings) ProtoMessage ¶
func (*Settings) ProtoMessage()
func (*Settings) ProtoReflect ¶
func (x *Settings) ProtoReflect() protoreflect.Message
func (*Settings) Validate ¶
Validate checks the field values on Settings 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 (*Settings) ValidateAll ¶
ValidateAll checks the field values on Settings 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 SettingsMultiError, or nil if none found.
type SettingsMultiError ¶
type SettingsMultiError []error
SettingsMultiError is an error wrapping multiple validation errors returned by Settings.ValidateAll() if the designated constraints aren't met.
func (SettingsMultiError) AllErrors ¶
func (m SettingsMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SettingsMultiError) Error ¶
func (m SettingsMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SettingsValidationError ¶
type SettingsValidationError struct {
// contains filtered or unexported fields
}
SettingsValidationError is the validation error returned by Settings.Validate if the designated constraints aren't met.
func (SettingsValidationError) Cause ¶
func (e SettingsValidationError) Cause() error
Cause function returns cause value.
func (SettingsValidationError) Error ¶
func (e SettingsValidationError) Error() string
Error satisfies the builtin error interface
func (SettingsValidationError) ErrorName ¶
func (e SettingsValidationError) ErrorName() string
ErrorName returns error name.
func (SettingsValidationError) Field ¶
func (e SettingsValidationError) Field() string
Field function returns field value.
func (SettingsValidationError) Key ¶
func (e SettingsValidationError) Key() bool
Key function returns key value.
func (SettingsValidationError) Reason ¶
func (e SettingsValidationError) Reason() string
Reason function returns reason value.