Documentation ¶
Index ¶
- Constants
- func AnnotateObject(obj client.Object, namespace string)
- func ConditionMarshal(conditions []metav1.Condition) ([]byte, error)
- func Contains(slice []string, target string) bool
- func ContainsObjectKey(a []client.ObjectKey, x client.ObjectKey) bool
- func CopyConditions(conditions []metav1.Condition) []metav1.Condition
- func DecodeFile(ctx context.Context, fileData []byte, scheme *runtime.Scheme, ...) error
- func DeleteKuadrantAnnotationFromGateway(gw *gatewayapiv1alpha2.Gateway, namespace string)
- func FetchEnv(key string, def string) string
- func FindAuthorinoStatusCondition(conditions []authorinov1beta1.Condition, conditionType string) *authorinov1beta1.Condition
- func FindDeploymentStatusCondition(conditions []appsv1.DeploymentCondition, conditionType string) *appsv1.DeploymentCondition
- func FindObjectKey(a []client.ObjectKey, x client.ObjectKey) int
- func GetDefaultIfNil[T any](val *T, def T) T
- func GetKuadrantNamespace(obj client.Object) (string, error)
- func GetNamespaceFromPolicy(policy KuadrantPolicy) (string, bool)
- func GetNamespaceFromPolicyTargetRef(ctx context.Context, cli client.Client, policy KuadrantPolicy) (string, error)
- func GetServicePortNumber(ctx context.Context, k8sClient client.Client, svcKey client.ObjectKey, ...) (int32, error)
- func GetWASMShimImageVersion() string
- func HostnamesToStrings(hostnames []gatewayapiv1alpha2.Hostname) []string
- func IsKuadrantManaged(obj client.Object) bool
- func IsObjectTaggedToDelete(obj client.Object) bool
- func IsOwnedBy(owned, owner client.Object) bool
- func IsTargetRefGateway(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
- func IsTargetRefHTTPRoute(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
- func MarshallNamespace(gwKey client.ObjectKey, domain string) string
- func MergeMapStringString(existing *map[string]string, desired map[string]string) bool
- func NamespacedNameToObjectKey(namespacedName, defaultNamespace string) client.ObjectKey
- func ObjectInfo(obj client.Object) string
- func ObjectKeyListDifference(a, b []client.ObjectKey) []client.ObjectKey
- func RouteHTTPMethodToRuleMethod(httpMethod *gatewayapiv1alpha2.HTTPMethod) []string
- func RouteHostnames(route *gatewayapiv1alpha2.HTTPRoute) []string
- func StatusConditionsMarshalJSON(input []metav1.Condition) ([]byte, error)
- func TagObjectToDelete(obj client.Object)
- func UnMarshallLimitNamespace(ns string) (client.ObjectKey, string, error)
- func UnMarshallObjectKey(keyStr string) (client.ObjectKey, error)
- func ValidSubdomains(domains, subdomains []string) (bool, string)
- type DecodeCallback
- type HTTPRouteRule
- type KuadrantPolicy
- type Name
Constants ¶
const ( KuadrantRateLimitClusterName = "kuadrant-rate-limiting-service" HTTPRouteKind = "HTTPRoute" KuadrantRateLimitPolicyRefAnnotation = "kuadrant.io/ratelimitpolicies" RateLimitPolicyBackRefAnnotation = "kuadrant.io/ratelimitpolicy-direct-backref" AuthPolicyBackRefAnnotation = "kuadrant.io/authpolicy-backref" KuadrantNamespaceLabel = "kuadrant.io/namespace" NamespaceSeparator = '/' LimitadorName = "limitador" )
TODO: move the const to a proper place, or get it from config
const ( DeleteTagAnnotation = "kuadrant.io/delete" ReadyStatusConditionType = "Ready" )
Variables ¶
This section is empty.
Functions ¶
func AnnotateObject ¶ added in v0.2.0
func ConditionMarshal ¶
ConditionMarshal marshals the set of conditions as a JSON array, sorted by condition type.
func ContainsObjectKey ¶ added in v0.2.0
ContainsObjectKey tells whether a contains x
func CopyConditions ¶
CopyConditions copies the set of conditions
func DecodeFile ¶
func DeleteKuadrantAnnotationFromGateway ¶ added in v0.2.0
func DeleteKuadrantAnnotationFromGateway(gw *gatewayapiv1alpha2.Gateway, namespace string)
func FindAuthorinoStatusCondition ¶
func FindAuthorinoStatusCondition(conditions []authorinov1beta1.Condition, conditionType string) *authorinov1beta1.Condition
func FindDeploymentStatusCondition ¶
func FindDeploymentStatusCondition(conditions []appsv1.DeploymentCondition, conditionType string) *appsv1.DeploymentCondition
func FindObjectKey ¶ added in v0.2.0
FindObjectKey returns the smallest index i at which x == a[i], or len(a) if there is no such index.
func GetDefaultIfNil ¶ added in v0.2.0
func GetDefaultIfNil[T any](val *T, def T) T
func GetKuadrantNamespace ¶ added in v0.2.0
func GetNamespaceFromPolicy ¶ added in v0.2.0
func GetNamespaceFromPolicy(policy KuadrantPolicy) (string, bool)
func GetNamespaceFromPolicyTargetRef ¶ added in v0.2.0
func GetServicePortNumber ¶ added in v0.2.0
func GetServicePortNumber(ctx context.Context, k8sClient client.Client, svcKey client.ObjectKey, svcPort string) (int32, error)
GetServicePortNumber returns the port number from the referenced key and port info the port info can be named port or already a number.
func GetWASMShimImageVersion ¶ added in v0.2.0
func GetWASMShimImageVersion() string
func HostnamesToStrings ¶ added in v0.2.0
func HostnamesToStrings(hostnames []gatewayapiv1alpha2.Hostname) []string
converts []gatewayapi_v1alpha2.Hostname to []string
func IsKuadrantManaged ¶ added in v0.2.0
func IsObjectTaggedToDelete ¶
func IsTargetRefGateway ¶ added in v0.2.0
func IsTargetRefGateway(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
func IsTargetRefHTTPRoute ¶ added in v0.2.0
func IsTargetRefHTTPRoute(targetRef gatewayapiv1alpha2.PolicyTargetReference) bool
func MarshallNamespace ¶ added in v0.2.0
MarshallNamespace serializes limit namespace with format "gwNS/gwName#domain"
func MergeMapStringString ¶ added in v0.2.0
MergeMapStringString Merge desired into existing. Not Thread-Safe. Does it matter?
func NamespacedNameToObjectKey ¶ added in v0.2.0
NamespacedNameToObjectKey converts <namespace/name> format string to k8s object key. It's common for K8s to reference an object using this format. For e.g. gateways in VirtualService.
func ObjectInfo ¶
func ObjectKeyListDifference ¶
ObjectKeyListDifference computest a - b
func RouteHTTPMethodToRuleMethod ¶ added in v0.2.0
func RouteHTTPMethodToRuleMethod(httpMethod *gatewayapiv1alpha2.HTTPMethod) []string
func RouteHostnames ¶ added in v0.2.0
func RouteHostnames(route *gatewayapiv1alpha2.HTTPRoute) []string
func StatusConditionsMarshalJSON ¶ added in v0.2.0
StatusConditionsMarshalJSON marshals the list of conditions as a JSON array, sorted by condition type.
func TagObjectToDelete ¶
func UnMarshallLimitNamespace ¶ added in v0.2.0
UnMarshallLimitNamespace parses limit namespace with format "gwNS/gwName#domain"
func UnMarshallObjectKey ¶ added in v0.2.0
func ValidSubdomains ¶ added in v0.2.0
ValidSubdomains returns (true, "") when every single subdomains item is a subset of at least one of the domains. Domains and subdomains may be prefixed with a wildcard label (*.). The wildcard label must appear by itself as the first label. When one of the subdomains is not a subset of any of the domains, it returns false and the subdomain not being subset of any of the domains
Types ¶
type DecodeCallback ¶
type HTTPRouteRule ¶ added in v0.2.0
func RulesFromHTTPRoute ¶ added in v0.2.0
func RulesFromHTTPRoute(route *gatewayapiv1alpha2.HTTPRoute) []HTTPRouteRule
RulesFromHTTPRoute computes a list of rules from the HTTPRoute object
type KuadrantPolicy ¶ added in v0.2.0
type KuadrantPolicy interface { client.Object GetTargetRef() gatewayapiv1alpha2.PolicyTargetReference GetWrappedNamespace() gatewayapiv1alpha2.Namespace }
type Name ¶ added in v0.2.0
type Name string
Name describes a (possibly wildcarded) hostname