Skip to content
Docs Try Aspire

GolangAppHostingExtension Methods

Class Methods 3 members
Provides extension methods for adding Golang applications to an Hosting.IDistributedApplicationBuilder.
AddGolangApp(IDistributedApplicationBuilder, string, string, string[]) Section titled AddGolangApp(IDistributedApplicationBuilder, string, string, string[]) extension IResourceBuilder<GolangAppExecutableResource>
Adds a Golang application to the application model. Executes the executable Golang app.
public static class GolangAppHostingExtension
{
public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(
this IDistributedApplicationBuilder builder,
string name,
string workingDirectory,
string[] args)
{
// ...
}
}
builder IDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder to add the resource to.
name string The name of the resource.
workingDirectory string The working directory to use for the command. If null, the working directory of the current process is used.
args string[] The optional arguments to be passed to the executable when it is started.
IResourceBuilder<GolangAppExecutableResource> A reference to the ApplicationModel.IResourceBuilder`1.
AddGolangApp(IDistributedApplicationBuilder, string, string, string[]?, string[]?) Section titled AddGolangApp(IDistributedApplicationBuilder, string, string, string[]?, string[]?) extension IResourceBuilder<GolangAppExecutableResource>
Adds a Golang application to the application model. Executes the executable Golang app.
public static class GolangAppHostingExtension
{
public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(
this IDistributedApplicationBuilder builder,
string name,
string workingDirectory,
string[]? args = null,
string[]? buildTags = null)
{
// ...
}
}
builder IDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder to add the resource to.
name string The name of the resource.
workingDirectory string The working directory to use for the command. If null, the working directory of the current process is used.
args string[]? optional The optional arguments to be passed to the executable when it is started.
buildTags string[]? optional The optional build tags to be used when building the Golang application.
IResourceBuilder<GolangAppExecutableResource> A reference to the ApplicationModel.IResourceBuilder`1.
AddGolangApp(IDistributedApplicationBuilder, string, string, string, string[]?, string[]?) Section titled AddGolangApp(IDistributedApplicationBuilder, string, string, string, string[]?, string[]?) extension IResourceBuilder<GolangAppExecutableResource>
Adds a Golang application to the application model. Executes the executable Golang app.
public static class GolangAppHostingExtension
{
public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(
this IDistributedApplicationBuilder builder,
string name,
string workingDirectory,
string executable,
string[]? args = null,
string[]? buildTags = null)
{
// ...
}
}
builder IDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder to add the resource to.
name string The name of the resource.
workingDirectory string The working directory to use for the command. If null, the working directory of the current process is used.
executable string The path to the Golang package directory or source file to be executed. Use "." to execute the program in the current directory. For example, "./cmd/server".
args string[]? optional The optional arguments to be passed to the executable when it is started.
buildTags string[]? optional The optional build tags to be used when building the Golang application.
IResourceBuilder<GolangAppExecutableResource> A reference to the ApplicationModel.IResourceBuilder`1.