Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

YarpRoute

Handle
📦 Aspire.Hosting.Yarp v17.0.0

Represents a route for YARP

type YarpRoute interface{}

Methods

methodWithMatch
Set the parameters used to match requests.
WithMatch(match *YarpRouteMatch) YarpRoute
match*YarpRouteMatch
YarpRoute

Returns a handle; failures surface later via Err().

Only match requests that contain all of these headers.
WithMatchHeaders(headers []*YarpRouteHeaderMatch) YarpRoute
headers[]*YarpRouteHeaderMatch
YarpRoute

Returns a handle; failures surface later via Err().

Only match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
WithMatchHosts(hosts []string) YarpRoute
hosts[]string
YarpRoute

Returns a handle; failures surface later via Err().

Only match requests that use these optional HTTP methods. E.g. GET, POST.
WithMatchMethods(methods []string) YarpRoute
methods[]string
YarpRoute

Returns a handle; failures surface later via Err().

Only match requests with the given Path pattern.
WithMatchPath(path string) YarpRoute
pathstring
YarpRoute

Returns a handle; failures surface later via Err().

Only match requests that contain all of these query parameters.
WithMatchRouteQueryParameter(queryParameters []*YarpRouteQueryParameterMatch) YarpRoute
queryParameters[]*YarpRouteQueryParameterMatch
YarpRoute

Returns a handle; failures surface later via Err().

Set the MaxRequestBodySize for the destination
WithMaxRequestBodySize(maxRequestBodySize float64) YarpRoute
maxRequestBodySizefloat64
YarpRoute

Returns a handle; failures surface later via Err().

Set the Metadata of the destination
WithMetadata(metadata map[string]string) YarpRoute
metadatamap[string]string
YarpRoute

Returns a handle; failures surface later via Err().

methodWithOrder
Set the order for the destination
WithOrder(order *float64) YarpRoute
order*float64
YarpRoute

Returns a handle; failures surface later via Err().

Add a new transform to the destination.
WithTransform(transform map[string]string) YarpRoute
transformmap[string]string
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will set the given header with the Base64 encoded client certificate.
WithTransformClientCertHeader(headerName string) YarpRoute
headerNamestring
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will enable or suppress copying request headers to the proxy request.
WithTransformCopyRequestHeaders(options ...*WithTransformCopyRequestHeadersOptions) YarpRoute
options...*WithTransformCopyRequestHeadersOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformCopyRequestHeadersOptions argument.

Copy*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will enable or suppress copying response headers to the client response.
WithTransformCopyResponseHeaders(options ...*WithTransformCopyResponseHeadersOptions) YarpRoute
options...*WithTransformCopyResponseHeadersOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformCopyResponseHeadersOptions argument.

Copy*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will enable or suppress copying response trailers to the client response.
WithTransformCopyResponseTrailers(options ...*WithTransformCopyResponseTrailersOptions) YarpRoute
options...*WithTransformCopyResponseTrailersOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformCopyResponseTrailersOptions argument.

Copy*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will add the Forwarded header as defined by RFC 7239.
WithTransformForwarded(options ...*WithTransformForwardedOptions) YarpRoute
options...*WithTransformForwardedOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformForwardedOptions argument.

UseHost*bool
UseProto*bool
ForFormat*NodeFormat
ByFormat*NodeFormat
Action*ForwardedTransformActions
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform that will replace the HTTP method if it matches.
WithTransformHttpMethodChange(
fromHttpMethod string,
toHttpMethod string,
) YarpRoute
fromHttpMethodstring
toHttpMethodstring
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will prefix the request path with the given value.
WithTransformPathPrefix(prefix string) YarpRoute
prefixstringThe path prefix to add.
YarpRoute

The configured YarpRoute.

Returns a handle; failures surface later via Err().

Adds the transform which will remove the matching prefix from the request path.
WithTransformPathRemovePrefix(prefix string) YarpRoute
prefixstringThe matching prefix to remove.
YarpRoute

The configured YarpRoute.

Returns a handle; failures surface later via Err().

Adds the transform which will set the request path with route values.
WithTransformPathRouteValues(pattern string) YarpRoute
patternstringThe route pattern to apply.
YarpRoute

The configured YarpRoute.

Returns a handle; failures surface later via Err().

Adds the transform which sets the request path with the given value.
WithTransformPathSet(path string) YarpRoute
pathstringThe path value to set.
YarpRoute

The configured YarpRoute.

Returns a handle; failures surface later via Err().

Adds the transform that will remove the given query key.
WithTransformQueryRemoveKey(queryKey string) YarpRoute
queryKeystring
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform that will append or set the query parameter from a route value.
WithTransformQueryRouteValue(
queryKey string,
routeValueKey string,
options ...*WithTransformQueryRouteValueOptions,
) YarpRoute
queryKeystring
routeValueKeystring
options...*WithTransformQueryRouteValueOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformQueryRouteValueOptions argument.

Append*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform that will append or set the query parameter from the given value.
WithTransformQueryValue(
queryKey string,
value string,
options ...*WithTransformQueryValueOptions,
) YarpRoute
queryKeystring
valuestring
options...*WithTransformQueryValueOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformQueryValueOptions argument.

Append*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will append or set the request header.
WithTransformRequestHeader(
headerName string,
value string,
options ...*WithTransformRequestHeaderOptions,
) YarpRoute
headerNamestring
valuestring
options...*WithTransformRequestHeaderOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformRequestHeaderOptions argument.

Append*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will remove the request header.
WithTransformRequestHeaderRemove(headerName string) YarpRoute
headerNamestring
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will append or set the request header from a route value.
WithTransformRequestHeaderRouteValue(
headerName string,
routeValueKey string,
options ...*WithTransformRequestHeaderRouteValueOptions,
) YarpRoute
headerNamestring
routeValueKeystring
options...*WithTransformRequestHeaderRouteValueOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformRequestHeaderRouteValueOptions argument.

Append*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will only copy the allowed request headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.
WithTransformRequestHeadersAllowed(allowedHeaders []string) YarpRoute
allowedHeaders[]string
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will append or set the response header.
WithTransformResponseHeader(
headerName string,
value string,
options ...*WithTransformResponseHeaderOptions,
) YarpRoute
headerNamestring
valuestring
options...*WithTransformResponseHeaderOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformResponseHeaderOptions argument.

Append*bool
Condition*ResponseCondition
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will remove the response header.
WithTransformResponseHeaderRemove(
headerName string,
options ...*WithTransformResponseHeaderRemoveOptions,
) YarpRoute
headerNamestring
options...*WithTransformResponseHeaderRemoveOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformResponseHeaderRemoveOptions argument.

Condition*ResponseCondition
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will only copy the allowed response headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.
WithTransformResponseHeadersAllowed(allowedHeaders []string) YarpRoute
allowedHeaders[]string
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will append or set the response trailer.
WithTransformResponseTrailer(
headerName string,
value string,
options ...*WithTransformResponseTrailerOptions,
) YarpRoute
headerNamestring
valuestring
options...*WithTransformResponseTrailerOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformResponseTrailerOptions argument.

Append*bool
Condition*ResponseCondition
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will remove the response trailer.
WithTransformResponseTrailerRemove(
headerName string,
options ...*WithTransformResponseTrailerRemoveOptions,
) YarpRoute
headerNamestring
options...*WithTransformResponseTrailerRemoveOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformResponseTrailerRemoveOptions argument.

Condition*ResponseCondition
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will only copy the allowed response trailers. Other transforms that modify or append to existing trailers may be affected if not included in the allow list.
WithTransformResponseTrailersAllowed(allowedHeaders []string) YarpRoute
allowedHeaders[]string
YarpRoute

Returns a handle; failures surface later via Err().

Set the Transforms of the destination
WithTransforms(transforms []map[string]string) YarpRoute
transforms[]map[string]string
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will copy the incoming request Host header to the proxy request.
WithTransformUseOriginalHostHeader(options ...*WithTransformUseOriginalHostHeaderOptions) YarpRoute
options...*WithTransformUseOriginalHostHeaderOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformUseOriginalHostHeaderOptions argument.

UseOriginal*bool
YarpRoute

Returns a handle; failures surface later via Err().

Adds the transform which will add X-Forwarded-* headers.
WithTransformXForwarded(options ...*WithTransformXForwardedOptions) YarpRoute
options...*WithTransformXForwardedOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithTransformXForwardedOptions argument.

HeaderPrefix*string
XDefault*ForwardedTransformActions
XFor*ForwardedTransformActions
XHost*ForwardedTransformActions
XProto*ForwardedTransformActions
XPrefix*ForwardedTransformActions
YarpRoute

Returns a handle; failures surface later via Err().