SurrealDbServerResource

Handle
📦 CommunityToolkit.Aspire.Hosting.SurrealDb v13.6.1

A resource that represents a SurrealDB container.

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

Properties

propertyConnectionStringExpression*ReferenceExpressionget
Gets the connection string expression for the SurrealDB instance.
ConnectionStringExpression() *ReferenceExpression
propertyHostEndpointReferenceExpressionget
Gets the host endpoint reference for this resource.
Host() EndpointReferenceExpression
propertyNamespacesmap[string]stringget
A dictionary where the key is the resource name and the value is the namespace name.
Namespaces() (map[string]string, error)
propertyPasswordParameterParameterResourceget
Gets the parameter that contains the SurrealDB password.
PasswordParameter() ParameterResource
propertyPortEndpointReferenceExpressionget
Gets the port endpoint reference for this resource.
Port() EndpointReferenceExpression
propertyPrimaryEndpointEndpointReferenceget
Gets the primary endpoint for the SurrealDB instance.
PrimaryEndpoint() EndpointReference
propertyUriExpression*ReferenceExpressionget
Gets the connection URI expression for the SurrealDB instance.
UriExpression() *ReferenceExpression
propertyUserNameParameterParameterResourceget
Gets the parameter that contains the SurrealDB username.
UserNameParameter() ParameterResource

Methods

methodAddNamespacebuilder
Adds a SurrealDB namespace resource to the application model
AddNamespace(
name string,
options ...*AddNamespaceOptions,
) SurrealDbNamespaceResource
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
options...*AddNamespaceOptionsOptional settings, described under Options.

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

NamespaceName*stringThe name of the namespace. If not provided, this defaults to the same value as name.
SurrealDbNamespaceResource

A reference to the IResourceBuilder.

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

methodWithDataBindMountbuilder
Adds a bind mount for the data folder to a SurrealDB resource.
WithDataBindMount(source string) SurrealDbServerResource
sourcestringThe source directory on the host to mount into the container.
SurrealDbServerResource

The IResourceBuilder.

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

methodWithDataVolumebuilder
Adds a named volume for the data folder to a SurrealDB resource.
WithDataVolume(options ...*WithDataVolumeOptions) SurrealDbServerResource
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.
SurrealDbServerResource

The IResourceBuilder.

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

methodWithInitFilesbuilder
Copies init files into a SurrealDB container resource.
WithInitFiles(source string) SurrealDbServerResource
sourcestringThe source file on the host to copy into the container.
SurrealDbServerResource

The IResourceBuilder.

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

methodWithLogLevelbuilder
WithLogLevel(logLevel string) SurrealDbServerResource
logLevelstring
SurrealDbServerResource

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

Injects the appropriate environment variables to allow the resource to enable sending telemetry to the dashboard. 1. It sets the OTLP endpoint to the value of the DOTNET_DASHBOARD_OTLP_ENDPOINT_URL environment variable. 2. It sets the service name and instance id to the resource name and UID. Values are injected by the orchestrator. 3. It sets a small batch schedule delay in development. This reduces the delay that OTLP exporter waits to sends telemetry and makes the dashboard telemetry pages responsive.
WithSurrealDbOtlpExporter() SurrealDbServerResource
SurrealDbServerResource

The IResourceBuilder.

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

methodWithSurrealistbuilder
WithSurrealist(options ...*WithSurrealistOptions) SurrealDbServerResource
options...*WithSurrealistOptionsOptional settings, described under Options.

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

ContainerName*string
SurrealDbServerResource

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