Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ResourceWithEndpoints.WithEndpoint

Method
📦 Aspire.Hosting v17.0.0
func (ResourceWithEndpoints) WithEndpoint(options ...*WithEndpointOptions) ResourceWithEndpoints

Signature

methodWithEndpointbuilder
Adds a network endpoint
WithEndpoint(options ...*WithEndpointOptions) ResourceWithEndpoints
options...*WithEndpointOptionsOptional settings, described under Options.

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

Port*float64An optional port. This is the port that will be given to other resource to communicate with this resource.
TargetPort*float64This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
Scheme*stringAn optional scheme e.g. (http/https). Defaults to the protocol argument if it is defined or "tcp" otherwise.
Name*stringAn optional name of the endpoint. Defaults to the scheme name if not specified.
Env*stringAn optional name of the environment variable that will be used to inject the targetPort. If the target port is null one will be dynamically generated and assigned to the environment variable.
IsProxied*boolSpecifies if the endpoint will be proxied by DCP. Defaults to null.
IsExternal*boolIndicates that this endpoint should be exposed externally at publish time.
Protocol*ProtocolTypeNetwork protocol: TCP or UDP are supported today, others possibly in future.
ResourceWithEndpoints

The resource builder.

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

Defined on

A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.

Applies to

This function applies to the following types: