KubernetesGatewayResource.WithGatewayPathRoute
Method
type KubernetesGatewayResource interface { // ... omitted for brevity WithGatewayPathRoute( path string, endpoint EndpointReference, options ...*WithGatewayPathRouteOptions, ) KubernetesGatewayResource}Signature
method
WithGatewayPathRoute builderAdds a path-based routing rule to the gateway. The rule matches each hostname configured with
WithHostname , or all hosts when no hostname is configured, and routes matching traffic to the endpoint's backing Kubernetes service. This generates an HTTPRoute resource attached to the Gateway.WithGatewayPathRoute( path string, endpoint EndpointReference, options ...*WithGatewayPathRouteOptions,) KubernetesGatewayResourceParameters
pathstringThe URL path to match (e.g., "/" or "/api"). Must start with /.endpointEndpointReference The endpoint reference identifying the target service and port.options...*WithGatewayPathRouteOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithGatewayPathRouteOptions argument.
PathType *GatewayPathMatchType The path matching strategy. Defaults to PathPrefix .Returns
KubernetesGatewayResource The resource builder.
Returns a handle; failures surface later via Err().
Defined on
This method is defined on the following type: