mz_dyncfgs/lib.rs
1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! A registry of every mz_dyncfg.
11
12use mz_dyncfg::ConfigSet;
13
14/// Returns a new ConfigSet containing every `Config`` in Materialize.
15///
16/// Each time this is called, it returns a new ConfigSet disconnected from any
17/// others. It may be cloned and passed around, and updates to any of these
18/// copies will be reflected in the clones. Values from a `ConfigSet` may be
19/// copied to a disconnected `ConfigSet` via `ConfigUpdates`, which can be
20/// passed over the network to do the same across processes.
21///
22/// TODO(cfg): Consider replacing this with a static global registry powered by
23/// something like the `ctor` or `inventory` crate. This would solve the
24/// dependency issue of this crate depending on every crate that uses dyncfgs.
25/// However, on the other hand, it would involve managing the footgun of a
26/// Config being linked into one binary but not the other.
27pub fn all_dyncfgs() -> ConfigSet {
28 let mut configs = ConfigSet::default();
29 configs = mz_adapter_types::dyncfgs::all_dyncfgs(configs);
30 configs = mz_compute_types::dyncfgs::all_dyncfgs(configs);
31 configs = mz_controller_types::dyncfgs::all_dyncfgs(configs);
32 configs = mz_metrics::all_dyncfgs(configs);
33 configs = mz_persist_client::cfg::all_dyncfgs(configs);
34 configs = mz_storage_types::dyncfgs::all_dyncfgs(configs);
35 configs = mz_txn_wal::all_dyncfgs(configs);
36 configs
37}