GoAppResource

Handle
📦 Aspire.Hosting.Go v17.0.0
interface GoAppResource
extends IComputeResource,
IContainerFilesDestinationResource,
IResource,
IResourceWithArgs,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport,
IResourceWithServiceDiscovery {
readonly resourceTypeDisplayName: string;
withAppArgs(args: any[]): GoAppResource;
withDelveServer(options?: DelveServerOptions): GoAppResource;
withGoPrivate(
privatePatterns: string[],
authHost: string,
usernameArgName?: string,
tokenSecretId?: string): GoAppResource;
withModDownload(): GoAppResource;
withModTidy(): GoAppResource;
withModVendor(): GoAppResource;
withVetTool(): GoAppResource;
}

Properties

propertyresourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property

Methods

methodwithAppArgsbuilder
Passes extra arguments to the Go program at runtime. In normal run mode they appear after `go run .`; in Delve mode after the `--` separator.
withAppArgs(args: any[]): GoAppResource
argsany[]The program arguments (e.g., `"serve"`, `"--config"`, `"prod.yaml"`).
GoAppResource
methodwithDelveServerbuilder
Starts a configurable headless Delve debug server so that DAP-compatible clients can attach remotely. The application is launched with `dlv debug` instead of `go run`. Delve must be available on the PATH.
withDelveServer(options?: DelveServerOptions): GoAppResource
optionsDelveServerOptionsoptionalThe options that configure the Delve server. When `null`, the default options are used.
GoAppResource
methodwithGoPrivatebuilder
Configures private Go module authentication for publish-time Dockerfile generation.
withGoPrivate(
privatePatterns: string[],
authHost: string,
usernameArgName?: string,
tokenSecretId?: string): GoAppResource
privatePatternsstring[]One or more module path patterns that should bypass the public proxy and checksum database, e.g. `"*.mycompany.com"` or `"github.com/myorg"`. Passed verbatim to `GOPRIVATE`, which implicitly covers `GONOSUMCHECK` and `GONOPROXY`.
authHoststringThe Git host that requires authentication, e.g. `"github.com"`.
usernameArgNamestringoptional= GIT_USERThe Docker build-arg name for the Git username. Defaults to `"GIT_USER"`. Pass it at build time with `--build-arg GIT_USER=myuser`.
tokenSecretIdstringoptional= gittokenThe BuildKit secret ID for the Git access token. Defaults to `"gittoken"`. Pass it at build time with `--secret id=gittoken,src=/path/to/token`.
GoAppResource
methodwithModDownloadbuilder
Runs `go mod download` before starting the application, pre-fetching all module dependencies into the local module cache without modifying `go.sum`. The main application waits for the download step to complete successfully before launching.
withModDownload(): GoAppResource
GoAppResource
methodwithModTidybuilder
Runs `go mod tidy` before starting the application, ensuring `go.sum` is up to date. The main application waits for the tidy step to complete successfully before launching.
withModTidy(): GoAppResource
GoAppResource
methodwithModVendorbuilder
Runs `go mod vendor` before starting the application, caching all module dependencies in the local `vendor/` directory. The main application waits for the vendor step to complete successfully before launching.
withModVendor(): GoAppResource
GoAppResource
methodwithVetToolbuilder
Runs `go vet ./...` before starting the application to catch static analysis issues. The main application waits for the vet step to complete successfully before launching.
withVetTool(): GoAppResource
GoAppResource