Documentation
¶
Overview ¶
Package plugins describes the uconfig provider interface. it exists to enable uconfig.Classic without circular deps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUsage = errors.New("uconfig: usage request")
ErrUsage is returned when user has request usage message via some plugin, mostly flags.
Functions ¶
func RegisterTag ¶
func RegisterTag(name string)
RegisterTag allows providers to ensure their tag is unique. they must call this function from an init.
Types ¶
type Extension ¶ added in v0.14.0
Extension is the interface for plugins that need access to the full plugin list. Like all plugins, Extensions are set up in registration order — place them after any plugins they need to inspect (e.g. after file plugins so that paths are resolved).
type Plugin ¶
type Plugin interface {
Parse() error
}
Plugin is the common interface for all uConfig providers.
type Updater ¶ added in v0.14.0
type Updater interface {
// Updated blocks until the plugin's source has changed or ctx is done.
// Returns true if the source changed, false otherwise.
Updated(ctx context.Context) bool
}
Updater is an optional interface for plugins that can detect when their backing source has changed. It is used by Watch to trigger re-parsing. Any plugin type (Walker, Visitor, or Extension) can additionally implement Updater.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package defaults provides default value support for uconfig.
|
Package defaults provides default value support for uconfig. |
|
Package env provides environment variables support for uconfig
|
Package env provides environment variables support for uconfig |
|
Package file provides config file support for uconfig
|
Package file provides config file support for uconfig |
|
Package flag provides flags support for uconfig
|
Package flag provides flags support for uconfig |
|
Package secret enable uconfig to integrate with secret plugins.
|
Package secret enable uconfig to integrate with secret plugins. |