xds

package
v0.0.0-...-25e6f9d Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DescriptorKeyForOrg                = "org"
	OrgMetadataKey                     = "customorg"
	DescriptorKeyForEnvironment        = "environment"
	DescriptorKeyForPath               = "path"
	DescriptorKeyForMethod             = "method"
	DescriptorValueForAPIMethod        = "ALL"
	DescriptorValueForOperationMethod  = ":method"
	MetadataNamespaceForCustomPolicies = "apk.ratelimit.metadata"
	MetadataNamespaceForWSO2Policies   = "envoy.filters.http.ext_authz"
)

Constants relevant to the route related ratelimit configurations

View Source
const (
	RateLimiterDomain                    = "Default"
	RateLimitPolicyOperationLevel string = "OPERATION"
	RateLimitPolicyAPILevel       string = "API"
)

Constants relevant to the rate limit service

Variables

View Source
var (

	// KeyManagerList to store data
	KeyManagerList = make([]eventhubTypes.KeyManager, 0)
)

Functions

func DeleteAPILevelRateLimitPolicies

func DeleteAPILevelRateLimitPolicies(resolveRatelimitPolicyList []dpv1alpha1.ResolveRateLimitAPIPolicy)

DeleteAPILevelRateLimitPolicies delete the ratelimit xds cache

func DeleteCustomRateLimitPolicies

func DeleteCustomRateLimitPolicies(customRateLimitPolicy dpv1alpha1.CustomRateLimitPolicyDef)

DeleteCustomRateLimitPolicies delete the ratelimit xds cache

func DeleteResourceLevelRateLimitPolicies

func DeleteResourceLevelRateLimitPolicies(resolveRatelimitPolicyList []dpv1alpha1.ResolveRateLimitAPIPolicy)

DeleteResourceLevelRateLimitPolicies delete the ratelimit xds cache

func GenerateIdentifierForAPIWithUUID

func GenerateIdentifierForAPIWithUUID(vhost, uuid string) string

GenerateIdentifierForAPIWithUUID generates an identifier unique to the API

func GetEnforcerApplicationCache

func GetEnforcerApplicationCache() wso2_cache.SnapshotCache

GetEnforcerApplicationCache returns xds server cache.

func GetEnforcerApplicationKeyMappingCache

func GetEnforcerApplicationKeyMappingCache() wso2_cache.SnapshotCache

GetEnforcerApplicationKeyMappingCache returns xds server cache.

func GetEnforcerApplicationMappingCache

func GetEnforcerApplicationMappingCache() wso2_cache.SnapshotCache

GetEnforcerApplicationMappingCache returns xds server cache.

func GetEnforcerCache

func GetEnforcerCache() wso2_cache.SnapshotCache

GetEnforcerCache returns xds server cache.

func GetEnforcerSubscriptionCache

func GetEnforcerSubscriptionCache() wso2_cache.SnapshotCache

GetEnforcerSubscriptionCache returns xds server cache.

func GetRateLimiterCache

func GetRateLimiterCache() envoy_cachev3.SnapshotCache

GetRateLimiterCache returns xds server cache for rate limiter service.

func GetXdsCache

func GetXdsCache() envoy_cachev3.SnapshotCache

GetXdsCache returns xds server cache.

func SetEmptySnapshotupdate

func SetEmptySnapshotupdate(lable string) bool

SetEmptySnapshotupdate update empty snapshot

func UpdateRateLimitXDSCache

func UpdateRateLimitXDSCache(resolveRatelimitPolicyList []dpv1alpha1.ResolveRateLimitAPIPolicy)

UpdateRateLimitXDSCache updates the xDS cache of the RateLimiter.

func UpdateRateLimitXDSCacheForCustomPolicies

func UpdateRateLimitXDSCacheForCustomPolicies(customRateLimitPolicies dpv1alpha1.CustomRateLimitPolicyDef)

UpdateRateLimitXDSCacheForCustomPolicies updates the xDS cache of the RateLimiter for custom policies.

func UpdateRateLimiterPolicies

func UpdateRateLimiterPolicies(label string)

UpdateRateLimiterPolicies update the rate limiter xDS cache with latest rate limit policies

Types

type Callbacks

type Callbacks struct {
}

Callbacks is used to debug the xds server related communication.

func (*Callbacks) OnDeltaStreamClosed

func (cb *Callbacks) OnDeltaStreamClosed(id int64, node *core.Node)

OnDeltaStreamClosed is unused.

func (*Callbacks) OnDeltaStreamOpen

func (cb *Callbacks) OnDeltaStreamOpen(_ context.Context, id int64, typ string) error

OnDeltaStreamOpen is unused.

func (*Callbacks) OnFetchRequest

func (cb *Callbacks) OnFetchRequest(_ context.Context, req *discovery.DiscoveryRequest) error

OnFetchRequest prints debug logs

func (*Callbacks) OnFetchResponse

func (cb *Callbacks) OnFetchResponse(req *discovery.DiscoveryRequest, res *discovery.DiscoveryResponse)

OnFetchResponse prints debug logs

func (*Callbacks) OnStreamClosed

func (cb *Callbacks) OnStreamClosed(id int64, node *core.Node)

OnStreamClosed prints debug logs

func (*Callbacks) OnStreamDeltaRequest

func (cb *Callbacks) OnStreamDeltaRequest(id int64, req *discovery.DeltaDiscoveryRequest) error

OnStreamDeltaRequest is unused.

func (*Callbacks) OnStreamDeltaResponse

func (cb *Callbacks) OnStreamDeltaResponse(id int64, req *discovery.DeltaDiscoveryRequest, res *discovery.DeltaDiscoveryResponse)

OnStreamDeltaResponse is unused.

func (*Callbacks) OnStreamOpen

func (cb *Callbacks) OnStreamOpen(_ context.Context, id int64, typ string) error

OnStreamOpen prints debug logs

func (*Callbacks) OnStreamRequest

func (cb *Callbacks) OnStreamRequest(id int64, request *discovery.DiscoveryRequest) error

OnStreamRequest prints debug logs

func (*Callbacks) OnStreamResponse

func (cb *Callbacks) OnStreamResponse(context context.Context, id int64, request *discovery.DiscoveryRequest,
	response *discovery.DiscoveryResponse)

OnStreamResponse prints debug logs

func (*Callbacks) Report

func (cb *Callbacks) Report()

Report logs the fetches and requests.

type EnforcerInternalAPI

type EnforcerInternalAPI struct {
	// contains filtered or unexported fields
}

EnforcerInternalAPI struct use to hold enforcer resources

type EnvoyGatewayConfig

type EnvoyGatewayConfig struct {
	// contains filtered or unexported fields
}

EnvoyGatewayConfig struct use to hold envoy gateway resources

type EnvoyInternalAPI

type EnvoyInternalAPI struct {
	// contains filtered or unexported fields
}

EnvoyInternalAPI struct use to hold envoy resources and adapter internal resources

type IDHash

type IDHash struct{}

IDHash uses ID field as the node hash.

func (IDHash) ID

func (IDHash) ID(node *corev3.Node) string

ID uses the node ID field

Directories

Path Synopsis
Package common includes the common functions shared between enforcer and router callbacks.
Package common includes the common functions shared between enforcer and router callbacks.

Jump to

Keyboard shortcuts

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