gatewayapi

package
v1.23.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateRef

func CertificateRef(name, namespace string) gatewayapi_v1beta1.SecretObjectReference

func DowngradeRouteParentStatuses added in v1.22.0

func DowngradeRouteParentStatuses(routeParentStatuses []gatewayapi_v1beta1.RouteParentStatus) []gatewayapi_v1alpha2.RouteParentStatus

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func GatewayListenerParentRef

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

func GatewayParentRef

func GatewayParentRef(namespace, name string) gatewayapi_v1beta1.ParentReference

func GatewayParentRefV1Alpha2 added in v1.22.0

func GatewayParentRefV1Alpha2(namespace, name string) gatewayapi_v1alpha2.ParentReference

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func GroupPtr

func GroupPtr(group string) *gatewayapi_v1beta1.Group

func GroupPtrV1Alpha2 added in v1.22.0

func GroupPtrV1Alpha2(group string) *gatewayapi_v1alpha2.Group

TODO(sk): delete when Gateway API v1alpha2 support is dropped

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 HostnameDeref added in v1.21.0

func HostnameDeref(hostname *gatewayapi_v1beta1.Hostname) string

HostnameDeref returns the hostname as a string if it's not nil, or an empty string otherwise.

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 KindPtr

func KindPtr(kind string) *gatewayapi_v1beta1.Kind

func KindPtrV1Alpha2 added in v1.22.0

func KindPtrV1Alpha2(kind string) *gatewayapi_v1alpha2.Kind

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func ListenerHostname

func ListenerHostname(host string) *gatewayapi_v1beta1.Hostname

func NamespacePtr

func NamespacePtr(namespace string) *gatewayapi_v1beta1.Namespace

func NamespacePtrV1Alpha2 added in v1.22.0

func NamespacePtrV1Alpha2(namespace string) *gatewayapi_v1alpha2.Namespace

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func ObjectNamePtr

func ObjectNamePtr(name string) *gatewayapi_v1alpha2.ObjectName

func PortNumPtr

func PortNumPtr(port int) *gatewayapi_v1beta1.PortNumber

func PortNumPtrV1Alpha2 added in v1.22.0

func PortNumPtrV1Alpha2(port int) *gatewayapi_v1alpha2.PortNumber

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func PreciseHostname

func PreciseHostname(host string) *gatewayapi_v1beta1.PreciseHostname

func SectionNamePtr

func SectionNamePtr(sectionName string) *gatewayapi_v1beta1.SectionName

func SectionNamePtrV1Alpha2 added in v1.22.0

func SectionNamePtrV1Alpha2(sectionName string) *gatewayapi_v1alpha2.SectionName

TODO(sk): delete when Gateway API v1alpha2 support is dropped

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

func UpgradeBackendRef added in v1.22.0

func UpgradeBackendRef(backendRef gatewayapi_v1alpha2.BackendRef) gatewayapi_v1beta1.BackendRef

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func UpgradeHostnames added in v1.22.0

func UpgradeHostnames(hostnames []gatewayapi_v1alpha2.Hostname) []gatewayapi_v1beta1.Hostname

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func UpgradeParentRef added in v1.22.0

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func UpgradeParentRefs added in v1.22.0

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func UpgradeRouteParentStatus added in v1.22.0

func UpgradeRouteParentStatus(routeParentStatus gatewayapi_v1alpha2.RouteParentStatus) gatewayapi_v1beta1.RouteParentStatus

TODO(sk): delete when Gateway API v1alpha2 support is dropped

func UpgradeRouteParentStatuses added in v1.22.0

func UpgradeRouteParentStatuses(routeParentStatuses []gatewayapi_v1alpha2.RouteParentStatus) []gatewayapi_v1beta1.RouteParentStatus

TODO(sk): delete when Gateway API v1alpha2 support is dropped

Types

type ValidateListenersResult added in v1.21.0

type ValidateListenersResult struct {
	InsecurePort int
	SecurePort   int

	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:

  • all protocols are supported
  • each listener group (grouped by protocol, with HTTPS & TLS going together) uses a single port
  • listener hostnames are syntactically valid
  • hostnames within each listener group are unique

It returns the insecure & secure ports to use, as well as 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