WithCommand
Method
func (Resource) WithCommand( name string, displayName string, executeCommand func(arg ExecuteCommandContext) *ExecuteCommandResult, options ...*WithCommandOptions,) ResourceSignature
method
WithCommand builderAdds a resource command
WithCommand( name string, displayName string, executeCommand func(arg ExecuteCommandContext) *ExecuteCommandResult, options ...*WithCommandOptions,) ResourceParameters
namestringThe name of the command. The name uniquely identifies the command.displayName stringThe display name visible in UI.executeCommand func(arg ExecuteCommandContext) *ExecuteCommandResult callbackA callback that is executed when the command is executed. The callback is run inside the Aspire host. The callback result is used to indicate success or failure in the UI.options...*WithCommandOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithCommandOptions argument.
CommandOptions *CommandOptions Optional configuration for the command.Returns
ResourceThe resource builder.
Returns a handle; failures surface later via Err().
Applies to
This method applies to the following types: