Configuration
Interface
type Configuration interface{}5 members
Methods
method
ExistsChecks whether a configuration section exists.
Exists(key string) (bool, error)Parameters
keystringThe configuration key.Returns
(bool, error) true when the section exists; otherwise, false.
Returns (bool, error).
method
GetChildren Gets the child sections of a configuration handle.
GetChildren() ([]ConfigurationSection, error)Returns
([]ConfigurationSection, error) The child sections.
Returns ([]ConfigurationSection, error).
method
GetConfigValue Gets a configuration value by key.
GetConfigValue(key string) (*string, error)Parameters
keystringThe configuration key (e.g., "ConnectionStrings:Default").Returns
(*string, error) The configuration value, or null if not found.
Returns (*string, error).
method
GetConnectionString Gets a connection string by name.
GetConnectionString(name string) (*string, error)Parameters
namestringThe connection string name.Returns
(*string, error) The connection string value, or null if not found.
Returns (*string, error).
method
GetSection Gets a configuration section by key.
GetSection(key string) ConfigurationSectionParameters
keystringThe configuration key.Returns
ConfigurationSection The configuration section handle.
Returns a handle; failures surface later via Err().
Applies to
This interface applies to the following types: