rlptools

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

func WASMPluginMutator

func WASMPluginMutator(existingObj, desiredObj client.Object) (bool, error)

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

func (LimitList) Len

func (l LimitList) Len() int

func (LimitList) Less

func (l LimitList) Less(i, j int) bool

func (LimitList) Swap

func (l LimitList) Swap(i, j int)

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)

func (*WASMPlugin) ToStruct

func (w *WASMPlugin) ToStruct() (*_struct.Struct, error)

Jump to

Keyboard shortcuts

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