Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/frontend/src/components/api-reference/GoMemberCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ const parameters: { name: string; type: string; description?: string | null; isC
}))
: [];
const options = isCallable ? member.options : undefined;
// Variadic options are typed values named <Method without With><Parameter>, such as HttpEndpointPort.
const optionValuePrefix = member.name.replace(/^With(?=[A-Z])/, '');
const optionInterfaceName = `Option`;
if (options?.typeName) {
parameters.push({
name: getGoOptionsParameterName({ signature: member.signature ?? undefined, options }),
type: `...*${options.typeName}`,
type: options.isDirect ? `...*${options.typeName}` : `...${optionInterfaceName}`,
description: 'Optional settings, described under Options.',
});
}
Expand Down Expand Up @@ -183,8 +186,9 @@ const errorModelSegments =
) : (
<p class="mc-go-note">
Optional parameters are passed in a trailing{' '}
<code>{getGoOptionsParameterName({ signature: member.signature ?? undefined, options })} ...*{options.typeName}</code>{' '}
argument.
<code>{getGoOptionsParameterName({ signature: member.signature ?? undefined, options })} ...{optionInterfaceName}</code>{' '}
argument as typed option values, such as <code>aspire.{optionValuePrefix}{optionFields[0]?.name ?? 'Option'}(value)</code>. The{' '}
<code>*{options.typeName}</code> struct is still accepted for compatibility.
</p>
)}
{optionFields.length > 0 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Options are applied from left to right. Omitting an option preserves the default

The generated SDK still accepts pointer-based options structs for compatibility. DTO inputs that aren't variadic options, such as `AddContainerOptions`, retain their declared field types. Check the generated SDK for the exact types and option names available for your installed integrations.

Numeric parameters use the Go type that matches the underlying .NET type, such as `int`, `int64`, `float32`, `float64`, or an unsigned type, instead of always using `float64`. Obsolete .NET members aren't generated, unless an active method signature still needs the type. Generated `.go` files are formatted with `gofmt`.

The [`WithHttpEndpoint` API reference](/reference/api/go/aspire.hosting/withhttpendpoint/) describes the available endpoint settings.

## Errors
Expand Down
Loading