Documentation ¶
Overview ¶
Package azappconfig loads configuration from Azure App Configuration.
Index ¶
- type AppConfig
- type Option
- func WithCredential(credential azcore.TokenCredential) Option
- func WithKeyFilter(filter string) Option
- func WithKeySplitter(splitter func(string) []string) Option
- func WithLabelFilter(filter string) Option
- func WithLogHandler(handler slog.Handler) Option
- func WithPollInterval(interval time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
// contains filtered or unexported fields
}
AppConfig is a Provider that loads configuration from Azure App Configuration.
To create a new AppConfig, call New.
type Option ¶
type Option func(options *options)
Option configures the AppConfig with specific options.
func WithCredential ¶
func WithCredential(credential azcore.TokenCredential) Option
WithCredential provides the azcore.TokenCredential for Azure authentication.
By default, it uses azidentity.DefaultAzureCredential.
func WithKeyFilter ¶
WithKeyFilter provides key filter that will be used to select a set of configuration setting entities.
func WithKeySplitter ¶
WithKeySplitter provides the function used to split setting key into nested path. If it returns an nil/[]string{}/[]string{""}, the variable will be ignored.
For example, with the default splitter, a key like "parent/child/key" would be split into "parent", "child", and "key".
func WithLabelFilter ¶
WithLabelFilter provides label filter that will be used to select a set of configuration setting entities.
func WithLogHandler ¶
WithLogHandler provides the slog.Handler for logs from watch.
By default, it uses handler from slog.Default().
func WithPollInterval ¶
WithPollInterval provides the interval for polling the configuration.
The default interval is 1 minute.