Aspire.Hosting.Yarp
Official
📦 Aspire.Hosting.Yarpv17.0.0Import path
apphost/modules/aspire55Functions
17Types
17 types, 55 functions and 0 members
Handles
DTOs
struct
YarpActiveHealthCheckConfig6 fieldsstruct
YarpForwarderRequestConfig4 fieldsstruct
YarpHealthCheckConfig3 fieldsstruct
YarpHttpClientConfig7 fieldsstruct
YarpPassiveHealthCheckConfig3 fieldsstruct
YarpRouteHeaderMatch4 fieldsstruct
YarpRouteMatch5 fieldsstruct
YarpRouteQueryParameterMatch4 fieldsstruct
YarpSessionAffinityConfig5 fieldsstruct
YarpSessionAffinityCookieConfig8 fieldsstruct
YarpWebProxyConfig3 fieldsEnums
Functions
DistributedApplicationBuilder
YarpCluster
method
WithForwarderRequestConfigSet the forwarder request configuration for the cluster.
WithForwarderRequestConfig(config *YarpForwarderRequestConfig) YarpClustermethod
WithHealthCheckConfigSet the health check configuration for the cluster.
WithHealthCheckConfig(config *YarpHealthCheckConfig) YarpClustermethod
WithHttpClientConfigSet the HTTP client configuration for the cluster.
WithHttpClientConfig(config *YarpHttpClientConfig) YarpClustermethod
WithLoadBalancingPolicySet the LoadBalancingPolicy for the cluster.
WithLoadBalancingPolicy(policy string) YarpClustermethod
WithMetadataSet the Metadata for the cluster.
WithMetadata(metadata map[string]string) YarpClustermethod
WithSessionAffinityConfigSet the session affinity configuration for the cluster.
WithSessionAffinityConfig(config *YarpSessionAffinityConfig) YarpClusterYarpConfigurationBuilder
method
AddCatchAllRouteAdds a catch-all route for a cluster, endpoint, resource, or string destination target.
AddCatchAllRoute(target any) YarpRoutemethod
AddClusterFromEndpointAdds a cluster for an endpoint reference.
AddClusterFromEndpoint(endpoint EndpointReference) YarpClustermethod
AddClusterFromExternalServiceAdds a cluster for an external service resource.
AddClusterFromExternalService(externalService ExternalServiceResource) YarpClustermethod
AddClusterFromResourceAdds a cluster for a resource that supports service discovery.
AddClusterFromResource(resource ResourceWithServiceDiscovery) YarpClustermethod
AddClusterWithDestinationAdds a cluster from a single destination.
AddClusterWithDestination(clusterName string, destination any) YarpClustermethod
AddClusterWithDestinationsAdds a cluster from multiple destinations.
AddClusterWithDestinations(clusterName string, destinations []any) YarpClustermethod
AddRouteAdds a route for a cluster, endpoint, resource, or string destination target.
AddRoute(path string, target any) YarpRouteYarpResource
method
PublishWithStaticFilesbuilderIn publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
PublishWithStaticFiles(resourceWithFiles ResourceWithContainerFiles) YarpResourcemethod
WithConfigurationbuilderConfigure the YARP resource.
WithConfiguration(configurationBuilder func(obj YarpConfigurationBuilder)) YarpResourcemethod
WithHostHttpsPortbuilderConfigures the host HTTPS port that the YARP resource is exposed on instead of using randomly assigned port. This will only have effect if an HTTPS endpoint is configured on the YARP resource due to TLS termination being enabled.
WithHostHttpsPort(port *float64) YarpResourcemethod
WithHostPortbuilderConfigures the host port that the YARP resource is exposed on instead of using randomly assigned port.
WithHostPort(port *float64) YarpResourcemethod
WithStaticFilesbuilderEnables static file serving in the YARP resource.
WithStaticFiles(options ...*WithStaticFilesOptions) YarpResourceYarpRoute
method
WithMatchSet the parameters used to match requests.
WithMatch(match *YarpRouteMatch) YarpRoutemethod
WithMatchHeadersOnly match requests that contain all of these headers.
WithMatchHeaders(headers []*YarpRouteHeaderMatch) YarpRoutemethod
WithMatchHostsOnly match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
WithMatchHosts(hosts []string) YarpRoutemethod
WithMatchMethodsOnly match requests that use these optional HTTP methods. E.g. GET, POST.
WithMatchMethods(methods []string) YarpRoutemethod
WithMatchPathOnly match requests with the given Path pattern.
WithMatchPath(path string) YarpRoutemethod
WithMatchRouteQueryParameterOnly match requests that contain all of these query parameters.
WithMatchRouteQueryParameter(queryParameters []*YarpRouteQueryParameterMatch) YarpRoutemethod
WithMaxRequestBodySizeSet the MaxRequestBodySize for the destination
WithMaxRequestBodySize(maxRequestBodySize float64) YarpRoutemethod
WithMetadataSet the Metadata of the destination
WithMetadata(metadata map[string]string) YarpRoutemethod
WithOrderSet the order for the destination
WithOrder(order *float64) YarpRoutemethod
WithTransformAdd a new transform to the destination.
WithTransform(transform map[string]string) YarpRoutemethod
WithTransformClientCertHeaderAdds the transform which will set the given header with the Base64 encoded client certificate.
WithTransformClientCertHeader(headerName string) YarpRoutemethod
WithTransformCopyRequestHeadersAdds the transform which will enable or suppress copying request headers to the proxy request.
WithTransformCopyRequestHeaders(options ...*WithTransformCopyRequestHeadersOptions) YarpRoutemethod
WithTransformCopyResponseHeadersAdds the transform which will enable or suppress copying response headers to the client response.
WithTransformCopyResponseHeaders(options ...*WithTransformCopyResponseHeadersOptions) YarpRoutemethod
WithTransformCopyResponseTrailersAdds the transform which will enable or suppress copying response trailers to the client response.
WithTransformCopyResponseTrailers(options ...*WithTransformCopyResponseTrailersOptions) YarpRoutemethod
WithTransformForwardedAdds the transform which will add the Forwarded header as defined by RFC 7239.
WithTransformForwarded(options ...*WithTransformForwardedOptions) YarpRoutemethod
WithTransformHttpMethodChangeAdds the transform that will replace the HTTP method if it matches.
WithTransformHttpMethodChange(fromHttpMethod string, toHttpMethod string) YarpRoutemethod
WithTransformPathPrefixAdds the transform which will prefix the request path with the given value.
WithTransformPathPrefix(prefix string) YarpRoutemethod
WithTransformPathRemovePrefixAdds the transform which will remove the matching prefix from the request path.
WithTransformPathRemovePrefix(prefix string) YarpRoutemethod
WithTransformPathRouteValuesAdds the transform which will set the request path with route values.
WithTransformPathRouteValues(pattern string) YarpRoutemethod
WithTransformPathSetAdds the transform which sets the request path with the given value.
WithTransformPathSet(path string) YarpRoutemethod
WithTransformQueryRemoveKeyAdds the transform that will remove the given query key.
WithTransformQueryRemoveKey(queryKey string) YarpRoutemethod
WithTransformQueryRouteValueAdds the transform that will append or set the query parameter from a route value.
WithTransformQueryRouteValue(queryKey string, routeValueKey string, options ...*WithTransformQueryRouteValueOptions) YarpRoutemethod
WithTransformQueryValueAdds the transform that will append or set the query parameter from the given value.
WithTransformQueryValue(queryKey string, value string, options ...*WithTransformQueryValueOptions) YarpRoutemethod
WithTransformRequestHeaderAdds the transform which will append or set the request header.
WithTransformRequestHeader(headerName string, value string, options ...*WithTransformRequestHeaderOptions) YarpRoutemethod
WithTransformRequestHeaderRemoveAdds the transform which will remove the request header.
WithTransformRequestHeaderRemove(headerName string) YarpRoutemethod
WithTransformRequestHeaderRouteValueAdds the transform which will append or set the request header from a route value.
WithTransformRequestHeaderRouteValue(headerName string, routeValueKey string, options ...*WithTransformRequestHeaderRouteValueOptions) YarpRoutemethod
WithTransformRequestHeadersAllowedAdds 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) YarpRoutemethod
WithTransformResponseHeaderAdds the transform which will append or set the response header.
WithTransformResponseHeader(headerName string, value string, options ...*WithTransformResponseHeaderOptions) YarpRoutemethod
WithTransformResponseHeaderRemoveAdds the transform which will remove the response header.
WithTransformResponseHeaderRemove(headerName string, options ...*WithTransformResponseHeaderRemoveOptions) YarpRoutemethod
WithTransformResponseHeadersAllowedAdds 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) YarpRoutemethod
WithTransformResponseTrailerAdds the transform which will append or set the response trailer.
WithTransformResponseTrailer(headerName string, value string, options ...*WithTransformResponseTrailerOptions) YarpRoutemethod
WithTransformResponseTrailerRemoveAdds the transform which will remove the response trailer.
WithTransformResponseTrailerRemove(headerName string, options ...*WithTransformResponseTrailerRemoveOptions) YarpRoutemethod
WithTransformResponseTrailersAllowedAdds 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) YarpRoutemethod
WithTransformsSet the Transforms of the destination
WithTransforms(transforms []map[string]string) YarpRoutemethod
WithTransformUseOriginalHostHeaderAdds the transform which will copy the incoming request Host header to the proxy request.
WithTransformUseOriginalHostHeader(options ...*WithTransformUseOriginalHostHeaderOptions) YarpRoutemethod
WithTransformXForwardedAdds the transform which will add X-Forwarded-* headers.
WithTransformXForwarded(options ...*WithTransformXForwardedOptions) YarpRoute