istio: istio.io/istio/mixer/adapter/redisquota/config Index | Files

package config

import "istio.io/istio/mixer/adapter/redisquota/config"

Index

Package Files

config.pb.go

Variables

var (
    ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowConfig   = fmt.Errorf("proto: integer overflow")
)
var Params_QuotaAlgorithm_name = map[int32]string{
    0:  "FIXED_WINDOW",
    1:  "ROLLING_WINDOW",
}
var Params_QuotaAlgorithm_value = map[string]int32{
    "FIXED_WINDOW":   0,
    "ROLLING_WINDOW": 1,
}

type Params Uses

type Params struct {
    // The set of known quotas. At least one quota configuration is required
    Quotas []Params_Quota `protobuf:"bytes,1,rep,name=quotas,proto3" json:"quotas"`
    // Redis connection string `<hostname>:<port number>`
    // ex) localhost:6379
    RedisServerUrl string `protobuf:"bytes,2,opt,name=redis_server_url,json=redisServerUrl,proto3" json:"redis_server_url,omitempty"`
    // Maximum number of idle connections to redis
    // Default is 10 connections per every CPU as reported by runtime.NumCPU.
    ConnectionPoolSize int64 `protobuf:"varint,3,opt,name=connection_pool_size,json=connectionPoolSize,proto3" json:"connection_pool_size,omitempty"`
}

redisquota adapter supports the rate limit quota using either fixed or rolling window algorithm. And it is using Redis as a shared data storage.

Example configuration:

“`yaml redisServerUrl: localhost:6379 connectionPoolSize: 10 quotas: - name: requestcount.quota.istio-system

maxAmount: 50
validDuration: 60s
bucketDuration: 1s
rateLimitAlgorithm: ROLLING_WINDOW
overrides:
- dimensions:
    destination: ratings
    source: reviews
  maxAmount: 12
- dimensions:
    destination: reviews
  maxAmount: 5

“`

func (*Params) Descriptor Uses

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

func (*Params) Marshal Uses

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo Uses

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer Uses

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ProtoMessage Uses

func (*Params) ProtoMessage()

func (*Params) Reset Uses

func (m *Params) Reset()

func (*Params) Size Uses

func (m *Params) Size() (n int)

func (*Params) String Uses

func (this *Params) String() string

func (*Params) Unmarshal Uses

func (m *Params) Unmarshal(dAtA []byte) error

func (*Params) XXX_DiscardUnknown Uses

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal Uses

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge Uses

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size Uses

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal Uses

func (m *Params) XXX_Unmarshal(b []byte) error

type Params_Override Uses

type Params_Override struct {
    // The specific dimensions for which this override applies.
    // String representation of instance dimensions is used to check against configured dimensions.
    // `dimensions` should not be empty
    Dimensions map[string]string `protobuf:"bytes,1,rep,name=dimensions,proto3" json:"dimensions" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    // The upper limit for this quota override.
    // This value should be bigger than 0
    MaxAmount int64 `protobuf:"varint,2,opt,name=max_amount,json=maxAmount,proto3" json:"max_amount,omitempty"`
}

func (*Params_Override) Descriptor Uses

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

func (*Params_Override) GetDimensions Uses

func (m *Params_Override) GetDimensions() map[string]string

func (*Params_Override) GetMaxAmount Uses

func (m *Params_Override) GetMaxAmount() int64

func (*Params_Override) Marshal Uses

func (m *Params_Override) Marshal() (dAtA []byte, err error)

func (*Params_Override) MarshalTo Uses

func (m *Params_Override) MarshalTo(dAtA []byte) (int, error)

func (*Params_Override) MarshalToSizedBuffer Uses

func (m *Params_Override) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params_Override) ProtoMessage Uses

func (*Params_Override) ProtoMessage()

func (*Params_Override) Reset Uses

func (m *Params_Override) Reset()

func (*Params_Override) Size Uses

func (m *Params_Override) Size() (n int)

func (*Params_Override) String Uses

func (this *Params_Override) String() string

func (*Params_Override) Unmarshal Uses

func (m *Params_Override) Unmarshal(dAtA []byte) error

func (*Params_Override) XXX_DiscardUnknown Uses

func (m *Params_Override) XXX_DiscardUnknown()

func (*Params_Override) XXX_Marshal Uses

func (m *Params_Override) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params_Override) XXX_Merge Uses

func (m *Params_Override) XXX_Merge(src proto.Message)

func (*Params_Override) XXX_Size Uses

func (m *Params_Override) XXX_Size() int

func (*Params_Override) XXX_Unmarshal Uses

func (m *Params_Override) XXX_Unmarshal(b []byte) error

type Params_Quota Uses

type Params_Quota struct {
    // The name of the quota
    Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    // The upper limit for this quota. max_amount should be bigger than 0
    MaxAmount int64 `protobuf:"varint,2,opt,name=max_amount,json=maxAmount,proto3" json:"max_amount,omitempty"`
    // The amount of time allocated quota remains valid before it is
    // automatically released. This is only meaningful for rate limit quotas.
    // value should be `0 < validDuration`
    ValidDuration time.Duration `protobuf:"bytes,3,opt,name=valid_duration,json=validDuration,proto3,stdduration" json:"valid_duration"`
    // The `bucketDuration` will be ignored if `rateLimitAlgorithm` is `FIXED_WINDOW`
    // value should be `0 < bucketDuration < validDuration`
    BucketDuration time.Duration `protobuf:"bytes,4,opt,name=bucket_duration,json=bucketDuration,proto3,stdduration" json:"bucket_duration"`
    // Quota management algorithm. The default value is `FIXED_WINDOW`
    RateLimitAlgorithm Params_QuotaAlgorithm `protobuf:"varint,5,opt,name=rate_limit_algorithm,json=rateLimitAlgorithm,proto3,enum=adapter.redisquota.config.Params_QuotaAlgorithm" json:"rate_limit_algorithm,omitempty"`
    // Overrides associated with this quota.
    // The first matching override is applied.
    Overrides []*Params_Override `protobuf:"bytes,6,rep,name=overrides,proto3" json:"overrides,omitempty"`
}

func (*Params_Quota) Descriptor Uses

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

func (*Params_Quota) GetBucketDuration Uses

func (m *Params_Quota) GetBucketDuration() time.Duration

func (*Params_Quota) GetMaxAmount Uses

func (m *Params_Quota) GetMaxAmount() int64

func (*Params_Quota) GetName Uses

func (m *Params_Quota) GetName() string

func (*Params_Quota) GetOverrides Uses

func (m *Params_Quota) GetOverrides() []*Params_Override

func (*Params_Quota) GetRateLimitAlgorithm Uses

func (m *Params_Quota) GetRateLimitAlgorithm() Params_QuotaAlgorithm

func (*Params_Quota) GetValidDuration Uses

func (m *Params_Quota) GetValidDuration() time.Duration

func (*Params_Quota) Marshal Uses

func (m *Params_Quota) Marshal() (dAtA []byte, err error)

func (*Params_Quota) MarshalTo Uses

func (m *Params_Quota) MarshalTo(dAtA []byte) (int, error)

func (*Params_Quota) MarshalToSizedBuffer Uses

func (m *Params_Quota) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params_Quota) ProtoMessage Uses

func (*Params_Quota) ProtoMessage()

func (*Params_Quota) Reset Uses

func (m *Params_Quota) Reset()

func (*Params_Quota) Size Uses

func (m *Params_Quota) Size() (n int)

func (*Params_Quota) String Uses

func (this *Params_Quota) String() string

func (*Params_Quota) Unmarshal Uses

func (m *Params_Quota) Unmarshal(dAtA []byte) error

func (*Params_Quota) XXX_DiscardUnknown Uses

func (m *Params_Quota) XXX_DiscardUnknown()

func (*Params_Quota) XXX_Marshal Uses

func (m *Params_Quota) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params_Quota) XXX_Merge Uses

func (m *Params_Quota) XXX_Merge(src proto.Message)

func (*Params_Quota) XXX_Size Uses

func (m *Params_Quota) XXX_Size() int

func (*Params_Quota) XXX_Unmarshal Uses

func (m *Params_Quota) XXX_Unmarshal(b []byte) error

type Params_QuotaAlgorithm Uses

type Params_QuotaAlgorithm int32

Algorithms for rate-limiting:

const (
    // `FIXED_WINDOW` The fixed window approach can allow 2x peak specified rate, whereas the rolling-window doesn't.
    FIXED_WINDOW Params_QuotaAlgorithm = 0
    // `ROLLING_WINDOW` The rolling window algorithm's additional precision comes at the cost of increased redis resource usage.
    ROLLING_WINDOW Params_QuotaAlgorithm = 1
)

func (Params_QuotaAlgorithm) EnumDescriptor Uses

func (Params_QuotaAlgorithm) EnumDescriptor() ([]byte, []int)

func (Params_QuotaAlgorithm) String Uses

func (x Params_QuotaAlgorithm) String() string

Package config imports 12 packages (graph) and is imported by 3 packages. Updated 2019-10-22. Refresh now. Tools for package owners.