Documentation
¶
Overview ¶
Package plugins describes the xconfig provider interface. it exists to enable xconfig.Classic without circular deps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUsage = errors.New("xconfig: 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 FieldChange ¶ added in v0.3.2
type FieldChange struct {
// FieldName is the full flat field path, e.g. "Database.Postgres.Password".
FieldName string
// OldValue is the previous value.
OldValue string
// NewValue is the updated value.
NewValue string
}
FieldChange describes a single config field change detected during refresh.
type Plugin ¶
type Plugin interface {
Parse() error
}
Plugin is the common interface for all xconfig providers.
type Refreshable ¶ added in v0.3.2
type Refreshable interface {
Plugin
// Refresh re-fetches values from the external source, updates changed fields,
// and returns a list of changes. Called periodically by Config.StartRefresh.
Refresh(ctx context.Context) ([]FieldChange, error)
}
Refreshable is implemented by plugins that support background config refresh. Examples: vault, consul, etcd, AWS SSM sourcers.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package defaults provides default values for xconfig
|
Package defaults provides default values for xconfig |
|
Package defaults provides default values for xconfig
|
Package defaults provides default values for xconfig |
|
Package env provides environment variables support for xconfig
|
Package env provides environment variables support for xconfig |
|
Package flag provides flags support for xconfig
|
Package flag provides flags support for xconfig |
|
Package file provides config loader support for xconfig
|
Package file provides config loader support for xconfig |
|
Package secret enable xconfig to integrate with secret plugins.
|
Package secret enable xconfig to integrate with secret plugins. |
Click to show internal directories.
Click to hide internal directories.