Documentation ¶
Overview ¶
Package utils contains utility functions for gateway
Index ¶
- func GetAllowedListeners(parentRef gwv1beta1.ParentReference, routeGvk schema.GroupVersionKind, ...) []gwtypes.Listener
- func GetAllowedListenersAndSetStatus(parentRef gwv1beta1.ParentReference, routeGvk schema.GroupVersionKind, ...) []gwtypes.Listener
- func GetRateLimitIfGRPCRouteMatchesPolicy(routeMatch gwv1alpha2.GRPCRouteMatch, ...) *gwpav1alpha1.L7RateLimit
- func GetRateLimitIfHTTPRouteMatchesPolicy(routeMatch gwv1beta1.HTTPRouteMatch, ...) *gwpav1alpha1.L7RateLimit
- func GetRateLimitIfPortMatchesPolicy(port gwv1beta1.PortNumber, rateLimitPolicy gwpav1alpha1.RateLimitPolicy) *int64
- func GetRateLimitIfRouteHostnameMatchesPolicy(routeHostname string, rateLimitPolicy gwpav1alpha1.RateLimitPolicy) *gwpav1alpha1.L7RateLimit
- func GetValidHostnames(listenerHostname *gwv1beta1.Hostname, routeHostnames []gwv1beta1.Hostname) []string
- func GetValidListenersFromGateway(gw *gwv1beta1.Gateway) []gwtypes.Listener
- func GroupPointer(group string) *gwv1beta1.Group
- func HostnameMatchesWildcardHostname(hostname, wildcardHostname string) bool
- func IsAcceptedGateway(gateway *gwv1beta1.Gateway) bool
- func IsAcceptedGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool
- func IsAcceptedRateLimitPolicy(policy *gwpav1alpha1.RateLimitPolicy) bool
- func IsAcceptedSessionStickyPolicy(policy *gwpav1alpha1.SessionStickyPolicy) bool
- func IsActiveGateway(gateway *gwv1beta1.Gateway) bool
- func IsActiveGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool
- func IsEffectiveGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool
- func IsListenerAccepted(listenerStatus gwv1beta1.ListenerStatus) bool
- func IsListenerProgrammed(listenerStatus gwv1beta1.ListenerStatus) bool
- func IsRefToGateway(parentRef gwv1beta1.ParentReference, gateway client.ObjectKey) bool
- func IsRefToTarget(targetRef gwv1alpha2.PolicyTargetReference, object client.Object) bool
- func ObjectKey(obj client.Object) client.ObjectKey
- func SessionStickyPolicyMatchesService(policy *gwpav1alpha1.SessionStickyPolicy, svc *corev1.Service) bool
- func SessionStickyPolicyMatchesServiceImport(policy *gwpav1alpha1.SessionStickyPolicy, svcimp *mcsv1alpha1.ServiceImport) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllowedListeners ¶
func GetAllowedListeners( parentRef gwv1beta1.ParentReference, routeGvk schema.GroupVersionKind, routeGeneration int64, validListeners []gwtypes.Listener, ) []gwtypes.Listener
GetAllowedListeners returns the allowed listeners
func GetAllowedListenersAndSetStatus ¶ added in v1.2.0
func GetAllowedListenersAndSetStatus( parentRef gwv1beta1.ParentReference, routeGvk schema.GroupVersionKind, routeGeneration int64, validListeners []gwtypes.Listener, routeParentStatus gwv1beta1.RouteParentStatus, ) []gwtypes.Listener
GetAllowedListenersAndSetStatus returns the allowed listeners and set status
func GetRateLimitIfGRPCRouteMatchesPolicy ¶
func GetRateLimitIfGRPCRouteMatchesPolicy(routeMatch gwv1alpha2.GRPCRouteMatch, rateLimitPolicy gwpav1alpha1.RateLimitPolicy) *gwpav1alpha1.L7RateLimit
GetRateLimitIfGRPCRouteMatchesPolicy returns the rate limit config if the GRPC route matches the policy
func GetRateLimitIfHTTPRouteMatchesPolicy ¶
func GetRateLimitIfHTTPRouteMatchesPolicy(routeMatch gwv1beta1.HTTPRouteMatch, rateLimitPolicy gwpav1alpha1.RateLimitPolicy) *gwpav1alpha1.L7RateLimit
GetRateLimitIfHTTPRouteMatchesPolicy returns the rate limit config if the HTTP route matches the policy
func GetRateLimitIfPortMatchesPolicy ¶
func GetRateLimitIfPortMatchesPolicy(port gwv1beta1.PortNumber, rateLimitPolicy gwpav1alpha1.RateLimitPolicy) *int64
GetRateLimitIfPortMatchesPolicy returns true if the port matches the rate limit policy
func GetRateLimitIfRouteHostnameMatchesPolicy ¶
func GetRateLimitIfRouteHostnameMatchesPolicy(routeHostname string, rateLimitPolicy gwpav1alpha1.RateLimitPolicy) *gwpav1alpha1.L7RateLimit
GetRateLimitIfRouteHostnameMatchesPolicy returns the rate limit config if the route hostname matches the policy
func GetValidHostnames ¶
func GetValidHostnames(listenerHostname *gwv1beta1.Hostname, routeHostnames []gwv1beta1.Hostname) []string
GetValidHostnames returns the valid hostnames
func GetValidListenersFromGateway ¶
GetValidListenersFromGateway returns the valid listeners from the gateway
func GroupPointer ¶
GroupPointer returns a pointer to the given group
func HostnameMatchesWildcardHostname ¶
HostnameMatchesWildcardHostname returns true if the hostname matches the wildcard hostname
func IsAcceptedGateway ¶
IsAcceptedGateway returns true if the gateway is accepted
func IsAcceptedGatewayClass ¶
func IsAcceptedGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool
IsAcceptedGatewayClass returns true if the gateway class is accepted
func IsAcceptedRateLimitPolicy ¶
func IsAcceptedRateLimitPolicy(policy *gwpav1alpha1.RateLimitPolicy) bool
func IsAcceptedSessionStickyPolicy ¶
func IsAcceptedSessionStickyPolicy(policy *gwpav1alpha1.SessionStickyPolicy) bool
func IsActiveGateway ¶
IsActiveGateway returns true if the gateway is active
func IsActiveGatewayClass ¶
func IsActiveGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool
IsActiveGatewayClass returns true if the gateway class is active
func IsEffectiveGatewayClass ¶
func IsEffectiveGatewayClass(gatewayClass *gwv1beta1.GatewayClass) bool
IsEffectiveGatewayClass returns true if the gateway class is effective
func IsListenerAccepted ¶
func IsListenerAccepted(listenerStatus gwv1beta1.ListenerStatus) bool
IsListenerAccepted returns true if the listener is accepted
func IsListenerProgrammed ¶
func IsListenerProgrammed(listenerStatus gwv1beta1.ListenerStatus) bool
IsListenerProgrammed returns true if the listener is programmed
func IsRefToGateway ¶
func IsRefToGateway(parentRef gwv1beta1.ParentReference, gateway client.ObjectKey) bool
IsRefToGateway returns true if the parent reference is to the gateway
func IsRefToTarget ¶ added in v1.2.0
func IsRefToTarget(targetRef gwv1alpha2.PolicyTargetReference, object client.Object) bool
IsRefToTarget returns true if the target reference is to the target object
func SessionStickyPolicyMatchesService ¶
func SessionStickyPolicyMatchesService(policy *gwpav1alpha1.SessionStickyPolicy, svc *corev1.Service) bool
SessionStickyPolicyMatchesService returns true if the service matches the policy
func SessionStickyPolicyMatchesServiceImport ¶
func SessionStickyPolicyMatchesServiceImport(policy *gwpav1alpha1.SessionStickyPolicy, svcimp *mcsv1alpha1.ServiceImport) bool
SessionStickyPolicyMatchesServiceImport returns true if the ServiceImport matches the policy
Types ¶
This section is empty.