Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

NatsServerResource

Handle
📦 Aspire.Hosting.Nats v17.0.0

A resource that represents a NATS server container.

type NatsServerResource interface {
ExpressionValue
IComputeResource
Resource
ResourceWithArgs
ResourceWithConnectionString
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Properties

propertyConnectionStringExpression*ReferenceExpressionget
Gets the connection string expression for the NATS server.
ConnectionStringExpression() *ReferenceExpression
propertyHostEndpointReferenceExpressionget
Gets the host endpoint reference for this resource.
Host() EndpointReferenceExpression
propertyPasswordParameterParameterResourceget · set
Gets or sets the password for the NATS server.
PasswordParameter() ParameterResource
SetPasswordParameter(value ParameterResource) NatsServerResource
propertyPortEndpointReferenceExpressionget
Gets the port endpoint reference for this resource.
Port() EndpointReferenceExpression
propertyPrimaryEndpointEndpointReferenceget
Gets the primary endpoint for the NATS server.
PrimaryEndpoint() EndpointReference
propertyResourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property
ResourceTypeDisplayName() (string, error)
propertyUriExpression*ReferenceExpressionget
Gets the connection URI expression for the NATS server.
UriExpression() *ReferenceExpression
propertyUserNameParameterParameterResourceget · set
Gets or sets the user name for the NATS server.
UserNameParameter() ParameterResource
SetUserNameParameter(value ParameterResource) NatsServerResource
propertyUserNameReference*ReferenceExpressionget
Gets a reference to the user name for the NATS server.
UserNameReference() *ReferenceExpression

Methods

methodWithDataBindMountbuilder
Adds a bind mount for the data folder to a NATS container resource.
WithDataBindMount(
source string,
options ...*WithDataBindMountOptions,
) NatsServerResource
sourcestringThe source directory on the host to mount into the container.
options...*WithDataBindMountOptionsOptional settings, described under Options.

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

IsReadOnly*boolA flag that indicates if this is a read-only mount.
NatsServerResource

The resource builder.

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

methodWithDataVolumebuilder
Adds a named volume for the data folder to a NATS container resource.
WithDataVolume(options ...*WithDataVolumeOptions) NatsServerResource
options...*WithDataVolumeOptionsOptional settings, described under Options.

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

Name*stringThe name of the volume. Defaults to an auto-generated name based on the application and resource names.
IsReadOnly*boolA flag that indicates if this is a read-only volume.
NatsServerResource

The resource builder.

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

methodWithJetStreambuilder
Adds JetStream support to the NATS server resource.
WithJetStream() NatsServerResource
NatsServerResource

The resource builder.

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