Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

EndpointReference

Handle
📦 Aspire.Hosting v17.0.0

Represents an endpoint reference for a resource with endpoints.

type EndpointReference interface {
ExpressionValue
}

Properties

propertyBrowserOriginsEndpointReferenceExpressionget
Gets a deferred comma-separated list of browser-facing origins associated with this endpoint.
BrowserOrigins() EndpointReferenceExpression
propertyEndpointNamestringget
Gets the name of the endpoint associated with the endpoint reference.
EndpointName() (string, error)
propertyErrorMessage*stringget
Gets or sets a custom error message to be thrown when the endpoint annotation is not found.
ErrorMessage() (*string, error)
propertyExcludeReferenceEndpointboolget
Gets a value indicating whether this endpoint is excluded from the default set when referencing the resource's endpoints.
ExcludeReferenceEndpoint() (bool, error)
propertyExistsboolget
Gets a value indicating whether the endpoint exists.
Exists() (bool, error)
propertyHoststringget
Gets the host for this endpoint.
Host() (string, error)
propertyIsAllocatedboolget
Gets a value indicating whether the endpoint is allocated.
IsAllocated() (bool, error)
propertyIsHttpboolget
Gets a value indicating whether the endpoint uses HTTP scheme.
IsHttp() (bool, error)
propertyIsHttpsboolget
Gets a value indicating whether the endpoint uses HTTPS scheme.
IsHttps() (bool, error)
propertyIsHttpSchemeNamedEndpointboolget
Gets a value indicating whether the endpoint name is "http" or "https", ignoring case. This is a convention used to identify endpoints that will be resolved based on the scheme of the endpoint in service discovery rather than by the specific endpoint name. This is done to allow http endpoints that are dynamically updated to https to be mapped correctly despite the endpoint name no longer matching the scheme.
IsHttpSchemeNamedEndpoint() (bool, error)
propertyPortfloat64get
Gets the port for this endpoint.
Port() (float64, error)
propertyPrimaryBrowserOriginEndpointReferenceExpressionget
Gets the deferred primary browser-facing origin associated with this endpoint.
PrimaryBrowserOrigin() EndpointReferenceExpression
propertyResourceResourceWithEndpointsget
Gets the resource owner of the endpoint reference.
Resource() ResourceWithEndpoints
propertySchemestringget
Gets the scheme for this endpoint.
Scheme() (string, error)
propertyTargetPort*float64get
Gets the target port for this endpoint. If the port is dynamically allocated, this will return null.
TargetPort() (*float64, error)
propertyTlsEnabledboolget
Gets a value indicating whether TLS is enabled for this endpoint.
TlsEnabled() (bool, error)
propertyUrlstringget
Gets the URL for this endpoint.
Url() (string, error)

Methods

Gets a conditional expression that resolves to the enabledValue when TLS is enabled on the endpoint, or to the disabledValue otherwise.
GetTlsValue(
enabledValue *ReferenceExpression,
disabledValue *ReferenceExpression,
) *ReferenceExpression
enabledValue*ReferenceExpressionThe expression to evaluate when TLS is enabled (e.g., ",ssl=true").
disabledValue*ReferenceExpressionThe expression to evaluate when TLS is not enabled.
*ReferenceExpression

A conditional ReferenceExpression whose value tracks the TLS state of this endpoint.

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

Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
GetValueAsync(options ...*GetValueAsyncOptions) (*string, error)
options...*GetValueAsyncOptionsOptional settings, described under Options.

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

CancellationToken*CancellationTokenThe cancellation token.
(*string, error)

The URL of the endpoint.

Returns (*string, error).

methodProperty
Gets the specified property expression of the endpoint.
Property(property EndpointProperty) EndpointReferenceExpression
propertyEndpointPropertyThe EndpointProperty enum value to use in the reference.
EndpointReferenceExpression

An EndpointReferenceExpression representing the specified EndpointProperty.

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