Documentation ¶
Overview ¶
Package xds contains the implementation for the xds server cache updates
Index ¶
- Variables
- func DeleteAPI(uuid string, gatewayNames map[string]struct{}) error
- func ExtractUUIDFromAPIIdentifier(id string) (string, error)
- func ExtractVhostFromAPIIdentifier(id string) (string, error)
- func GenerateEnvoyResoucesForGateway(gatewayName string) ([]types.Resource, []types.Resource, []types.Resource, []types.Resource, ...)
- func GenerateGlobalClusters(label string)
- func GenerateHashedAPINameVersionIDWithoutVhost(name, version string) string
- func GenerateIdentifierForAPI(vhost, name, version string) string
- func GenerateIdentifierForAPIWithUUID(vhost, uuid string) string
- func GenerateIdentifierForAPIWithoutVersion(vhost, name string) string
- func GenerateIdentifierForAPIWithoutVhost(name, version string) string
- func GenerateInterceptorClusters(label string, gwReqICluster *clusterv3.Cluster, ...)
- func GenerateJWTProviders(label string, jwtIssuers map[string]*v1alpha1.ResolvedJWTIssuer)
- func GetEnforcerAPICache() wso2_cache.SnapshotCache
- func GetEnforcerApplicationPolicyCache() wso2_cache.SnapshotCache
- func GetEnforcerCache() wso2_cache.SnapshotCache
- func GetEnforcerJWTIssuerCache() wso2_cache.SnapshotCache
- func GetEnforcerKeyManagerCache() wso2_cache.SnapshotCache
- func GetEnforcerRevokedTokenCache() wso2_cache.SnapshotCache
- func GetEnforcerSubscriptionPolicyCache() wso2_cache.SnapshotCache
- func GetEnforcerThrottleDataCache() wso2_cache.SnapshotCache
- func GetEnvoyGatewayConfigClusters() int
- func GetEnvoyInternalAPIClusters() int
- func GetEnvoyInternalAPICount() int
- func GetEnvoyInternalAPIRoutes() int
- func GetLastSuccessState(label string) (*EnforcerAPIState, *RouterResourceState)
- func GetMajorMinorVersionRangeRegex(semVersion *semantic_version.SemVersion) string
- func GetMajorVersionRange(semVersion semantic_version.SemVersion) string
- func GetMinorVersionRange(semVersion semantic_version.SemVersion) string
- func GetMinorVersionRangeRegex(semVersion *semantic_version.SemVersion) string
- func GetRequestEventChannel() chan RequestEvent
- func GetVersionMatchRegex(version string) string
- func GetXdsCache() envoy_cachev3.SnapshotCache
- func GetvHostsIdentifier(UUID string, envType string) string
- func IsSemanticVersioningEnabled(apiName, apiVersion string) bool
- func MarshalConfig(config *config.Config) *enforcer.Config
- func PopulateInternalMaps(adapterInternalAPI *model.AdapterInternalAPI, ...) error
- func RemoveAPIFromAllInternalMaps(uuid string) map[string]struct{}
- func SanitizeGateway(gatewayName string, create bool) error
- func SetReady()
- func SetSuccessState(label string, enforerSuccessState EnforcerAPIState, ...)
- func UpdateEnforcerApis(label string, apis []types.Resource, version string)
- func UpdateEnforcerConfig(configFile *config.Config)
- func UpdateEnforcerJWTIssuers(jwtIssuers map[string]*v1alpha1.ResolvedJWTIssuer)
- func UpdateGatewayCache(gateway *gwapiv1.Gateway, resolvedListenerCerts map[string]map[string][]byte, ...) error
- func UpdateOrgAPIMap(vHosts, newLabels map[string]struct{}, listener string, sectionName string, ...) error
- func UpdateXdsCacheOnAPIChange(labels map[string]struct{}) bool
- func UpdateXdsCacheWithLock(label string, endpoints []types.Resource, clusters []types.Resource, ...) bool
- type EnforcerAPIState
- type EnforcerInternalAPI
- type EnvoyGatewayConfig
- type EnvoyInternalAPI
- type EventType
- type IDHash
- type RequestEvent
- type RouterResourceState
Constants ¶
This section is empty.
Variables ¶
var ( // KeyManagerList to store data KeyManagerList = make([]eventhubTypes.KeyManager, 0) )
var ( // RequestEventChannel is the channel which communicates between callback and the server RequestEventChannel chan RequestEvent )
Functions ¶
func ExtractUUIDFromAPIIdentifier ¶
ExtractUUIDFromAPIIdentifier extracts UUID from the API identifier
func ExtractVhostFromAPIIdentifier ¶
ExtractVhostFromAPIIdentifier extracts vhost from the API identifier
func GenerateEnvoyResoucesForGateway ¶
func GenerateEnvoyResoucesForGateway(gatewayName string) ([]types.Resource, []types.Resource, []types.Resource, []types.Resource, []types.Resource)
GenerateEnvoyResoucesForGateway generates envoy resources for a given gateway This method will list out all APIs mapped to the label. and generate envoy resources for all of these APIs.
func GenerateGlobalClusters ¶
func GenerateGlobalClusters(label string)
GenerateGlobalClusters generates the globally available clusters and endpoints.
func GenerateHashedAPINameVersionIDWithoutVhost ¶
GenerateHashedAPINameVersionIDWithoutVhost generates a hashed identifier unique to the API Name and Version
func GenerateIdentifierForAPI ¶
GenerateIdentifierForAPI generates an identifier unique to the API
func GenerateIdentifierForAPIWithUUID ¶
GenerateIdentifierForAPIWithUUID generates an identifier unique to the API
func GenerateIdentifierForAPIWithoutVersion ¶
GenerateIdentifierForAPIWithoutVersion generates an identifier unique to the API despite of the version
func GenerateIdentifierForAPIWithoutVhost ¶
GenerateIdentifierForAPIWithoutVhost generates an identifier unique to the API name and version
func GenerateInterceptorClusters ¶
func GenerateInterceptorClusters(label string, gwReqICluster *clusterv3.Cluster, gwReqIAddresses []*corev3.Address, gwResICluster *clusterv3.Cluster, gwResIAddresses []*corev3.Address)
GenerateInterceptorClusters generates the globally available clusters and endpoints with interceptors.
func GenerateJWTProviders ¶
func GenerateJWTProviders(label string, jwtIssuers map[string]*v1alpha1.ResolvedJWTIssuer)
GenerateJWTProviders generates the JWT providers for the given label
func GetEnforcerAPICache ¶
func GetEnforcerAPICache() wso2_cache.SnapshotCache
GetEnforcerAPICache returns xds server cache.
func GetEnforcerApplicationPolicyCache ¶
func GetEnforcerApplicationPolicyCache() wso2_cache.SnapshotCache
GetEnforcerApplicationPolicyCache returns xds server cache.
func GetEnforcerCache ¶
func GetEnforcerCache() wso2_cache.SnapshotCache
GetEnforcerCache returns xds server cache.
func GetEnforcerJWTIssuerCache ¶
func GetEnforcerJWTIssuerCache() wso2_cache.SnapshotCache
GetEnforcerJWTIssuerCache returns xds server cache.
func GetEnforcerKeyManagerCache ¶
func GetEnforcerKeyManagerCache() wso2_cache.SnapshotCache
GetEnforcerKeyManagerCache returns xds server cache.
func GetEnforcerRevokedTokenCache ¶
func GetEnforcerRevokedTokenCache() wso2_cache.SnapshotCache
GetEnforcerRevokedTokenCache return token cache
func GetEnforcerSubscriptionPolicyCache ¶
func GetEnforcerSubscriptionPolicyCache() wso2_cache.SnapshotCache
GetEnforcerSubscriptionPolicyCache returns xds server cache.
func GetEnforcerThrottleDataCache ¶
func GetEnforcerThrottleDataCache() wso2_cache.SnapshotCache
GetEnforcerThrottleDataCache return throttle data cache
func GetEnvoyGatewayConfigClusters ¶
func GetEnvoyGatewayConfigClusters() int
GetEnvoyGatewayConfigClusters method gets the number of clusters in envoy gateway config
func GetEnvoyInternalAPIClusters ¶
func GetEnvoyInternalAPIClusters() int
GetEnvoyInternalAPIClusters method gets the number of clusters in envoy internal API
func GetEnvoyInternalAPICount ¶
func GetEnvoyInternalAPICount() int
GetEnvoyInternalAPICount method gets the number of APIs deployed in Envoy
func GetEnvoyInternalAPIRoutes ¶
func GetEnvoyInternalAPIRoutes() int
GetEnvoyInternalAPIRoutes method gets the number of routes in envoy internal API
func GetLastSuccessState ¶
func GetLastSuccessState(label string) (*EnforcerAPIState, *RouterResourceState)
GetLastSuccessState returns the successful enforcer state and router state which belongs to the provided label
func GetMajorMinorVersionRangeRegex ¶
func GetMajorMinorVersionRangeRegex(semVersion *semantic_version.SemVersion) string
GetMajorMinorVersionRangeRegex generates major and minor version compatible range regex for the given version
func GetMajorVersionRange ¶
func GetMajorVersionRange(semVersion semantic_version.SemVersion) string
GetMajorVersionRange generates major version range for the given version
func GetMinorVersionRange ¶
func GetMinorVersionRange(semVersion semantic_version.SemVersion) string
GetMinorVersionRange generates minor version range for the given version
func GetMinorVersionRangeRegex ¶
func GetMinorVersionRangeRegex(semVersion *semantic_version.SemVersion) string
GetMinorVersionRangeRegex generates minor version compatible range regex for the given version
func GetRequestEventChannel ¶
func GetRequestEventChannel() chan RequestEvent
GetRequestEventChannel returns the state change channel. RequestEventChannel should be a singleton object
func GetVersionMatchRegex ¶
GetVersionMatchRegex returns the regex to match the full version string
func GetXdsCache ¶
func GetXdsCache() envoy_cachev3.SnapshotCache
GetXdsCache returns xds server cache.
func GetvHostsIdentifier ¶
GetvHostsIdentifier creates a identifier for vHosts for a API considering prod and sand env
func IsSemanticVersioningEnabled ¶
IsSemanticVersioningEnabled checks whether semantic versioning is enabled for the given API
func MarshalConfig ¶
MarshalConfig will marshal a Config struct - read from the config toml - to enfocer's CDS resource representation.
func PopulateInternalMaps ¶
func PopulateInternalMaps(adapterInternalAPI *model.AdapterInternalAPI, labels, vHosts map[string]struct{}, sectionName, listenerName string) error
PopulateInternalMaps populates the internal maps from the GQLRoute.
func RemoveAPIFromAllInternalMaps ¶
RemoveAPIFromAllInternalMaps removes api from all maps
func SanitizeGateway ¶
SanitizeGateway method sanitizes the gateway name
func SetReady ¶
func SetReady()
SetReady Method to set the status after the last api is fected and updated in router.
func SetSuccessState ¶
func SetSuccessState(label string, enforerSuccessState EnforcerAPIState, routerSuccessState RouterResourceState)
SetSuccessState set the last successful state of enforcer and router
func UpdateEnforcerApis ¶
UpdateEnforcerApis Sets new update to the enforcer's Apis
func UpdateEnforcerConfig ¶
UpdateEnforcerConfig Sets new update to the enforcer's configuration
func UpdateEnforcerJWTIssuers ¶
func UpdateEnforcerJWTIssuers(jwtIssuers map[string]*v1alpha1.ResolvedJWTIssuer)
UpdateEnforcerJWTIssuers sets new update to the enforcer's Applications
func UpdateGatewayCache ¶
func UpdateGatewayCache(gateway *gwapiv1.Gateway, resolvedListenerCerts map[string]map[string][]byte, gwLuaScript string, customRateLimitPolicies []*model.CustomRateLimitPolicy) error
UpdateGatewayCache updates the xDS cache related to the Gateway Lifecycle event.
func UpdateOrgAPIMap ¶
func UpdateOrgAPIMap(vHosts, newLabels map[string]struct{}, listener string, sectionName string, adapterInternalAPI *model.AdapterInternalAPI) error
UpdateOrgAPIMap updates the xDS cache related to the API Lifecycle event.
func UpdateXdsCacheOnAPIChange ¶
UpdateXdsCacheOnAPIChange when this method is called, openAPIEnvoy map is updated. Old labels refers to the previously assigned labels New labels refers to the the updated labels
Types ¶
type EnforcerAPIState ¶
type EnforcerAPIState struct { OpenAPIEnforcerApisMap map[string]types.Resource APIUUIDToGatewayToVhosts map[string]map[string]string APIToVhostsMap map[string]map[string]struct{} Version string }
EnforcerAPIState Stores the last success state of the enforcer apis
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 EventType ¶
type EventType int
EventType is a enum to distinguish Create, Update and Delete Events
type RequestEvent ¶
RequestEvent is the event that is published by the xds callback (onStreamRequest)
type RouterResourceState ¶
type RouterResourceState struct { APIRoutesMap map[string][]*routev3.Route // Envoy Routes map APIClustersMap map[string][]*clusterv3.Cluster // Envoy Clusters map APIEndpointsMap map[string][]*corev3.Address EnvoyListenerConfigMap map[string][]*listenerv3.Listener // Listener Configuration map EnvoyRouteConfigMap map[string]*routev3.RouteConfiguration Version string }
RouterResourceState Stores the last successful state of the router resources
Source Files ¶
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. |