Skip to content

Releases: tarantool/go-config

v1.1.0

29 Apr 10:47

Choose a tag to compare

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, and DefaultSchemaURL (#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.Context as its first argument. Previously the function created context.Background() internally; callers must now supply a context, which is forwarded to DataSource.FetchStream. Migrate NewSource(src, fmt) to NewSource(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.json at Build() time, and schema selectors on tarantool.Builder are 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 Collectors to return an error wrapping ErrFormatParse that identifies the offending storage key, instead of being silently dropped. Use WithSkipInvalid(true) to restore the previous lenient behavior (#26).
  • tarantool.Builder: remove redundant roles merge strategy from defaults since MergeReplace is already the default inheritance behavior (#34).
  • tarantool.Builder: remove hardcoded leader exclusion from default inheritance options so leader is now inherited down the hierarchy like other keys. Users who need the old behavior can opt out via WithInheritanceOption(config.WithNoInherit("leader")) (#36).

Fixed

  • collectors.yaml: fix empty YAML mappings ({}) being silently dropped during parsing, which caused EffectiveAll() to miss leaf entities with empty configs (#32).
  • tree: preserve isArray flag 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, and Builder.WithInheritance no longer panic on nil inputs (#39).

v1.0.0

10 Mar 10:36

Choose a tag to compare

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.