WithGatewayHostRoute
Method
func (KubernetesGatewayResource) WithGatewayHostRoute( host string, path string, endpoint EndpointReference, options ...*WithGatewayHostRouteOptions,) KubernetesGatewayResourceSignature
method
WithGatewayHostRoute builderAdds a host-and-path-based routing rule to the gateway. The rule matches traffic for the specified host and path, routing it to the given endpoint's backing Kubernetes service. This generates an
HTTPRoute resource with a hostnames filter.WithGatewayHostRoute( host string, path string, endpoint EndpointReference, options ...*WithGatewayHostRouteOptions,) KubernetesGatewayResourceParameters
hoststringThe hostname to match (e.g., "api.example.com" ).pathstringThe URL path to match. Must start with /.endpointEndpointReference The endpoint reference identifying the target service and port.options...*WithGatewayHostRouteOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithGatewayHostRouteOptions argument.
PathType *GatewayPathMatchType The path matching strategy. Defaults to PathPrefix .Returns
KubernetesGatewayResource The resource builder.
Returns a handle; failures surface later via Err().
Applies to
This method applies to the following types: