gatewayapi

package
v1.28.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ContourHTTPSProtocolType = "projectcontour.io/https"

ContourHTTPSProtocolType is the protocol for an HTTPS Listener that is to be used with HTTPProxy/Ingress, where the TLS details are provided on the HTTPProxy/Ingress rather than on the Listener.

Variables

This section is empty.

Functions

func CertificateRef

func CertificateRef(name, namespace string) gatewayapi_v1beta1.SecretObjectReference

func GRPCHeaderMatch added in v1.25.0

func GRPCHeaderMatch(matchType gatewayapi_v1beta1.HeaderMatchType, name, value string) []gatewayapi_v1alpha2.GRPCHeaderMatch

func GRPCMethodMatch added in v1.25.0

func GRPCMethodMatch(matchType gatewayapi_v1alpha2.GRPCMethodMatchType, service, method string) *gatewayapi_v1alpha2.GRPCMethodMatch

func GRPCRouteBackendRef added in v1.25.0

func GRPCRouteBackendRef(serviceName string, port int, weight int32) []gatewayapi_v1alpha2.GRPCBackendRef

func GatewayListenerParentRef

func GatewayListenerParentRef(namespace, name, listener string, port int) gatewayapi_v1beta1.ParentReference

func GatewayParentRef

func GatewayParentRef(namespace, name string) gatewayapi_v1beta1.ParentReference

func HTTPBackendRef

func HTTPBackendRef(serviceName string, port int, weight int32) []gatewayapi_v1beta1.HTTPBackendRef

func HTTPHeaderMatch

func HTTPHeaderMatch(matchType gatewayapi_v1beta1.HeaderMatchType, name, value string) []gatewayapi_v1beta1.HTTPHeaderMatch

func HTTPQueryParamMatches added in v1.22.0

func HTTPQueryParamMatches(namesAndValues map[string]string) []gatewayapi_v1beta1.HTTPQueryParamMatch

func IsRefToGateway added in v1.22.0

func IsRefToGateway(parentRef gatewayapi_v1beta1.ParentReference, gateway types.NamespacedName) bool

IsRefToGateway returns whether the provided parent ref is a reference to a Gateway with the given namespace/name, irrespective of whether a section/listener name has been specified (i.e. a parent ref to a listener on the specified gateway will return "true").

func IsValidHostname added in v1.21.0

func IsValidHostname(hostname string) error

IsValidHostname validates that a given hostname is syntactically valid. It returns nil if valid and an error if not valid.

func ServiceBackendObjectRef

func ServiceBackendObjectRef(name string, port int) gatewayapi_v1beta1.BackendObjectReference

func TLSRouteBackendRef

func TLSRouteBackendRef(serviceName string, port int, weight *int32) []gatewayapi_v1alpha2.BackendRef

func TLSRouteBackendRefs

func TLSRouteBackendRefs(backendRefs ...[]gatewayapi_v1alpha2.BackendRef) []gatewayapi_v1alpha2.BackendRef

Types

type ListenerPort added in v1.26.0

type ListenerPort struct {
	Name          string
	Port          int32
	ContainerPort int32
	Protocol      string
}

type ValidateListenersResult added in v1.21.0

type ValidateListenersResult struct {
	// ListenerNames is a map from Gateway Listener name
	// to DAG/Envoy Listener name. All Gateway Listeners
	// that share a port map to the same DAG/Envoy Listener
	// name.
	ListenerNames map[string]string

	// Ports is a list of ports to listen on.
	Ports []ListenerPort

	// InvalidListenerConditions is a map from Gateway Listener name
	// to a condition to set, if the Listener is invalid.
	InvalidListenerConditions map[gatewayapi_v1beta1.SectionName]metav1.Condition
}

func ValidateListeners added in v1.21.0

func ValidateListeners(listeners []gatewayapi_v1beta1.Listener) ValidateListenersResult

ValidateListeners validates protocols, ports and hostnames on a set of listeners. It ensures that:

  • protocols are supported
  • hostnames are syntactically valid
  • listeners on each port have mutually compatible protocols
  • listeners on each port have unique hostnames

It returns a Listener name map, the ports to use, and conditions for all invalid listeners. If a listener is not in the "InvalidListenerConditions" map, it is assumed to be valid according to the above rules.

Jump to

Keyboard shortcuts

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