Releases: tarantool/go-config
Releases · tarantool/go-config
v1.1.0
Overview
This release ships offline JSON Schema validation by default with embedded schemas for Tarantool 3.3.0 – 3.7.0, makes the Storage collector strict about parse errors, and includes fixes for env-var resolution, tree merging, and nil-input handling on the builder. collectors.NewSource and tarantool.New() defaults change in backward-incompatible ways — see below.
Added
- Offline JSON Schema validation with embedded schemas for Tarantool 3.3.0 – 3.7.0, plus opt-in HTTP fetching via
WithSchemaURLDefault,WithSchemaURL,WithHTTPClient, andDefaultSchemaURL(#27). collectors.Storage.WithSkipInvalid(bool)to silently skip documents that failed to parse, restoring the pre-1.1 lenient behavior (#29).tarantool.Builder.WithEnvIgnore(patterns ...string)accepts shell-glob patterns for env-var names to drop before the env transform runs (#30).
Changed
- collectors.NewSource now takes
ctx context.Contextas its first argument. Previously the function createdcontext.Background()internally; callers must now supply a context, which is forwarded toDataSource.FetchStream. MigrateNewSource(src, fmt)toNewSource(ctx, src, fmt). This is a breaking change (#27). - tarantool.New() now uses the newest embedded JSON Schema by default instead of fetching
https://download.tarantool.org/tarantool/schema/config.schema.jsonatBuild()time, and schema selectors ontarantool.Builderare now mutually exclusive. This is a breaking change in default behavior (#27). - collectors.Storage is now strict by default: a document whose value fails to parse causes
Collectorsto return an error wrappingErrFormatParsethat identifies the offending storage key, instead of being silently dropped. UseWithSkipInvalid(true)to restore the previous lenient behavior (#26). - tarantool.Builder: remove redundant
rolesmerge strategy from defaults sinceMergeReplaceis already the default inheritance behavior (#34). - tarantool.Builder: remove hardcoded
leaderexclusion from default inheritance options soleaderis now inherited down the hierarchy like other keys. Users who need the old behavior can opt out viaWithInheritanceOption(config.WithNoInherit("leader"))(#36).
Fixed
- collectors.yaml: fix empty YAML mappings (
{}) being silently dropped during parsing, which causedEffectiveAll()to miss leaf entities with empty configs (#32). - tree: preserve
isArrayflag when merging numeric children into the config tree, so YAML sequences are correctly represented as arrays after inheritance resolution (#34). - tarantool: env vars with compound schema keys (e.g.
TT_AUDIT_LOG_NONBLOCK,TT_WAL_QUEUE_MAX_SIZE,TT_REPLICATION_FAILOVER) now resolve to the correct config path when a JSON schema is supplied (#31). - builder:
Builder.AddCollector,Builder.Build,Builder.WithValidator,Builder.WithJSONSchema,Builder.MustWithJSONSchema,Builder.WithMerger, andBuilder.WithInheritanceno longer panic on nil inputs (#39).
v1.0.0
Initial release of the go-config library providing a hierarchical configuration system with multiple source collectors (maps, files, directories, environment variables, key-value storage), flexible merging strategies, JSON Schema validation, and Tarantool-specific builder with inheritance support.
Added
- Configuration tree API with hierarchical data storage and safe value retrieval.
- Builder pattern for assembling configuration from multiple sources with priority-based merging.
- Collectors for reading configuration from: in-memory maps, YAML/JSON files, directories, environment variables, and key-value storage (etcd via go-storage).
- Hierarchical inheritance system: define multi-level hierarchies (e.g., global → group → replicaset → instance) with configurable merge strategies (replace, append, deep).
- Flexible merging with customizable Merger interface and default last-write-wins semantics.
- JSON Schema validation support for configuration integrity checking.
- Order preservation for deterministic key ordering when serializing configuration.
- Tarantool-specific builder with predefined defaults for Tarantool cluster configuration (env prefix, inheritance rules, schema validation).
- Storage integration with integrity verification via hash validation and signature checking.
- Watcher interface for reactive change notifications from storage backends.
- KeyPath type for configuration key manipulation with wildcard pattern support.
- MutableConfig for runtime configuration modifications with validation.