Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

InteractionService

Interface
📦 Aspire.Hosting v17.0.0

A service to interact with the current development environment.

type InteractionService interface{}

Methods

Creates a boolean (checkbox) input.
CreateBooleanInput(
name string,
options ...*CreateInteractionInputOptions,
) InteractionInputBuilder
namestring
options...*CreateInteractionInputOptionsOptional settings, described under Options.

Optional parameters are passed as the existing *CreateInteractionInputOptions struct.

InteractionInputBuilder

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

Creates a choice input that selects from a list of options.
CreateChoiceInput(
name string,
options ...*CreateChoiceInputOptions,
) InteractionInputBuilder
namestringThe name of the input.
options...*CreateChoiceInputOptionsOptional settings, described under Options.

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

Choices[]*InteractionChoiceOptionThe available choices, in display order. Each option pairs a submitted value with a display label.
Options*CreateInteractionInputOptionsOptional configuration for the input.
InteractionInputBuilder

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

Creates a file input.
CreateFileInput(
name string,
options ...*CreateInteractionInputOptions,
) InteractionInputBuilder
namestring
options...*CreateInteractionInputOptionsOptional settings, described under Options.

Optional parameters are passed as the existing *CreateInteractionInputOptions struct.

InteractionInputBuilder

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

Creates a numeric input.
CreateNumberInput(
name string,
options ...*CreateInteractionInputOptions,
) InteractionInputBuilder
namestring
options...*CreateInteractionInputOptionsOptional settings, described under Options.

Optional parameters are passed as the existing *CreateInteractionInputOptions struct.

InteractionInputBuilder

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

Creates a secret (masked) text input.
CreateSecretInput(
name string,
options ...*CreateInteractionInputOptions,
) InteractionInputBuilder
namestring
options...*CreateInteractionInputOptionsOptional settings, described under Options.

Optional parameters are passed as the existing *CreateInteractionInputOptions struct.

InteractionInputBuilder

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

Creates a single-line text input.
CreateTextInput(
name string,
options ...*CreateInteractionInputOptions,
) InteractionInputBuilder
namestring
options...*CreateInteractionInputOptionsOptional settings, described under Options.

Optional parameters are passed as the existing *CreateInteractionInputOptions struct.

InteractionInputBuilder

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

Gets a value indicating whether the interaction service is available to prompt the user.
IsAvailable() (bool, error)
(bool, error)

true when the service can prompt the user; otherwise false.

Returns (bool, error).

Prompts the user for confirmation with an OK/Cancel dialog.
PromptConfirmation(
title string,
message string,
options ...*PromptConfirmationOptions,
) (*BoolInteractionResult, error)
titlestring
messagestring
options...*PromptConfirmationOptionsOptional settings, described under Options.

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

Options*InteractionMessageBoxOptions
CancellationToken*CancellationToken
(*BoolInteractionResult, error)

Returns (*BoolInteractionResult, error).

Prompts the user for a single input.
PromptInput(
title string,
message string,
input InteractionInputBuilder,
options ...*PromptInputOptions,
) (*InputInteractionResult, error)
titlestring
messagestring
inputInteractionInputBuilder
options...*PromptInputOptionsOptional settings, described under Options.

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

Options*InteractionInputsDialogOptions
CancellationToken*CancellationToken
(*InputInteractionResult, error)

Returns (*InputInteractionResult, error).

Prompts the user for multiple inputs.
PromptInputs(
title string,
message string,
inputs []InteractionInputBuilder,
options ...*PromptInputsOptions,
) InputsInteractionResult
titlestring
messagestring
inputs[]InteractionInputBuilder
options...*PromptInputsOptionsOptional settings, described under Options.

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

Options*InteractionInputsDialogOptions
CancellationToken*CancellationToken
InputsInteractionResult

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

Prompts the user with a message box dialog.
PromptMessageBox(
title string,
message string,
options ...*PromptMessageBoxOptions,
) (*BoolInteractionResult, error)
titlestring
messagestring
options...*PromptMessageBoxOptionsOptional settings, described under Options.

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

Options*InteractionMessageBoxOptions
CancellationToken*CancellationToken
(*BoolInteractionResult, error)

Returns (*BoolInteractionResult, error).

Prompts the user with a notification.
PromptNotification(
title string,
message string,
options ...*PromptNotificationOptions,
) (*BoolInteractionResult, error)
titlestring
messagestring
options...*PromptNotificationOptionsOptional settings, described under Options.

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

Options*InteractionNotificationOptions
CancellationToken*CancellationToken
(*BoolInteractionResult, error)

Returns (*BoolInteractionResult, error).

Displays a progress dialog with an indeterminate progress indicator.
PromptProgress(
message string,
options ...*PromptProgressOptions,
) (*BoolInteractionResult, error)
messagestring
options...*PromptProgressOptionsOptional settings, described under Options.

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

Options*InteractionProgressOptions
CancellationToken*CancellationToken
(*BoolInteractionResult, error)

Returns (*BoolInteractionResult, error).

Applies to

This interface applies to the following types: