Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

Configuration

Interface
📦 Aspire.Hosting v17.0.0
type Configuration interface{}

Methods

methodExists
Checks whether a configuration section exists.
Exists(key string) (bool, error)
keystringThe configuration key.
(bool, error)

true when the section exists; otherwise, false.

Returns (bool, error).

Gets the child sections of a configuration handle.
GetChildren() ([]ConfigurationSection, error)
([]ConfigurationSection, error)

The child sections.

Returns ([]ConfigurationSection, error).

Gets a configuration value by key.
GetConfigValue(key string) (*string, error)
keystringThe configuration key (e.g., "ConnectionStrings:Default").
(*string, error)

The configuration value, or null if not found.

Returns (*string, error).

Gets a connection string by name.
GetConnectionString(name string) (*string, error)
namestringThe connection string name.
(*string, error)

The connection string value, or null if not found.

Returns (*string, error).

Gets a configuration section by key.
GetSection(key string) ConfigurationSection
keystringThe configuration key.
ConfigurationSection

The configuration section handle.

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

Applies to

This interface applies to the following types: