Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithGoPrivate

Method
📦 Aspire.Hosting.Go v17.0.0
func (GoAppResource) WithGoPrivate(
privatePatterns []string,
authHost string,
options ...*WithGoPrivateOptions,
) GoAppResource

Signature

methodWithGoPrivatebuilder
Configures private Go module authentication for publish-time Dockerfile generation.
WithGoPrivate(
privatePatterns []string,
authHost string,
options ...*WithGoPrivateOptions,
) GoAppResource
privatePatterns[]stringOne 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".
options...*WithGoPrivateOptionsOptional settings, described under Options.

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

UsernameArgName*stringThe Docker build-arg name for the Git username. Defaults to "GIT_USER". Pass it at build time with --build-arg GIT_USER=myuser.
TokenSecretId*stringThe 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

The resource builder.

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

Applies to

This method applies to the following types: