Documentation ¶
Index ¶
- Variables
- func DefaultGatewayConfiguration(key client.ObjectKey) []kuadrantv1beta1.Configuration
- func HTTPRouteRulesToRLPRules(httpRouteRules []common.HTTPRouteRule) []kuadrantv1beta1.Rule
- func SameLimitList(a, b []kuadrantv1beta1.Limit) bool
- func WASMPluginMutator(existingObj, desiredObj client.Object) (bool, error)
- type GatewayAction
- type GatewayActionsByDomain
- type LimitIndex
- func (l *LimitIndex) AddGatewayLimits(gwKey client.ObjectKey, gwLimits LimitsByDomain)
- func (l *LimitIndex) AddLimit(gwKey client.ObjectKey, domain string, limit *kuadrantv1beta1.Limit)
- func (l *LimitIndex) AddLimitFromRateLimit(limit *limitadorv1alpha1.RateLimit)
- func (l *LimitIndex) DeleteGateway(gwKey client.ObjectKey)
- func (l *LimitIndex) Equals(other *LimitIndex) bool
- func (l *LimitIndex) ToLimits() []limitadorv1alpha1.RateLimit
- type LimitList
- type LimitsByDomain
- type RateLimitPolicy
- type WASMPlugin
Constants ¶
This section is empty.
Variables ¶
View Source
var (
WASMFilterImageURL = common.FetchEnv("RELATED_IMAGE_WASMSHIM", "oci://quay.io/kuadrant/wasm-shim:latest")
)
Functions ¶
func DefaultGatewayConfiguration ¶ added in v0.3.0
func DefaultGatewayConfiguration(key client.ObjectKey) []kuadrantv1beta1.Configuration
func HTTPRouteRulesToRLPRules ¶
func HTTPRouteRulesToRLPRules(httpRouteRules []common.HTTPRouteRule) []kuadrantv1beta1.Rule
func SameLimitList ¶
func SameLimitList(a, b []kuadrantv1beta1.Limit) bool
Types ¶
type GatewayAction ¶
type GatewayAction struct { Configurations []kuadrantv1beta1.Configuration `json:"configurations"` // +optional Rules []kuadrantv1beta1.Rule `json:"rules,omitempty"` }
func GatewayActionsFromRateLimitPolicy ¶
func GatewayActionsFromRateLimitPolicy(rlp *kuadrantv1beta1.RateLimitPolicy, route *gatewayapiv1alpha2.HTTPRoute) []GatewayAction
GatewayActionsFromRateLimitPolicy return flatten list from GatewayAction from the RLP
type GatewayActionsByDomain ¶
type GatewayActionsByDomain map[string][]GatewayAction
func (GatewayActionsByDomain) String ¶
func (g GatewayActionsByDomain) String() string
type LimitIndex ¶
type LimitIndex struct {
// contains filtered or unexported fields
}
LimitIndex allows manage Limitador CR limits based on gateways and domains gateways and domains are encoded in the namespace field of the limit limit namespace format: "{gateway}#{domain}"
func NewLimitadorIndex ¶
func NewLimitadorIndex(limitador *limitadorv1alpha1.Limitador, logger logr.Logger) *LimitIndex
NewLimitadorIndex builds index to manage limits indexed by domain indexed by gateways yaml representation would be:
--- gateway_key1: domain_1: - maxValue: X seconds: Y conditions: [ ... ] variables: [ ... ] domain_2: - maxValue: X seconds: Y conditions: [ ... ] variables: [ ... ] gateway_key2: domain_1: - maxValue: X seconds: Y conditions: [ ... ] variables: [ ... ] domain_2: - maxValue: X seconds: Y conditions: [ ... ] variables: [ ... ]
func (*LimitIndex) AddGatewayLimits ¶
func (l *LimitIndex) AddGatewayLimits(gwKey client.ObjectKey, gwLimits LimitsByDomain)
func (*LimitIndex) AddLimit ¶
func (l *LimitIndex) AddLimit(gwKey client.ObjectKey, domain string, limit *kuadrantv1beta1.Limit)
AddLimit adds one new limit to the index structure
func (*LimitIndex) AddLimitFromRateLimit ¶
func (l *LimitIndex) AddLimitFromRateLimit(limit *limitadorv1alpha1.RateLimit)
AddLimitFromRateLimit adds one new limit to the index structure
func (*LimitIndex) DeleteGateway ¶
func (l *LimitIndex) DeleteGateway(gwKey client.ObjectKey)
func (*LimitIndex) Equals ¶
func (l *LimitIndex) Equals(other *LimitIndex) bool
func (*LimitIndex) ToLimits ¶
func (l *LimitIndex) ToLimits() []limitadorv1alpha1.RateLimit
type LimitList ¶
type LimitList []kuadrantv1beta1.Limit
type LimitsByDomain ¶
type LimitsByDomain map[string][]kuadrantv1beta1.Limit
func (LimitsByDomain) Equals ¶
func (l LimitsByDomain) Equals(other LimitsByDomain) bool
func (LimitsByDomain) String ¶
func (l LimitsByDomain) String() string
type RateLimitPolicy ¶
type RateLimitPolicy struct { Name string `json:"name"` RateLimitDomain string `json:"rate_limit_domain"` UpstreamCluster string `json:"upstream_cluster"` Hostnames []string `json:"hostnames"` // +optional GatewayActions []GatewayAction `json:"gateway_actions,omitempty"` }
type WASMPlugin ¶
type WASMPlugin struct { FailureModeDeny bool `json:"failure_mode_deny"` RateLimitPolicies []RateLimitPolicy `json:"rate_limit_policies"` }
func WASMPluginFromStruct ¶
func WASMPluginFromStruct(structure *_struct.Struct) (*WASMPlugin, error)
Click to show internal directories.
Click to hide internal directories.