Documentation
¶
Overview ¶
Package rc provides a configuration management system with support for override merging, validation, and hot-reloading capabilities. It uses JSON as the internal format and supports hierarchical configuration through path delimiters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateConfigSchema ¶
GenerateConfigSchema creates a JSON schema from a configuration struct pointer. It sets the title to "Remote config" and returns the generated schema. The cfgPtr should be a pointer to a struct that represents the configuration.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config manages configuration state with support for override merging and validation. It is safe for concurrent use.
func New ¶
New creates a new Config instance with the provided validator and override data. The overrideData is merged with new configuration data during upgrades. The default delimiter for hierarchical paths is "~".
func (*Config) Upgrade ¶
Upgrade processes new configuration data by merging it with overrides, unmarshaling into the provided config pointer, and validating the result. If validation succeeds, it stores the new config as the previous config. The prevConfigPtr is populated with the previous configuration state if available. Returns an error if merging, unmarshaling, or validation fails.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package schema provides JSON schema generation for Go structs with support for custom field properties, validation constraints, and tag-based configuration.
|
Package schema provides JSON schema generation for Go structs with support for custom field properties, validation constraints, and tag-based configuration. |