From 99e9188c7cbfabee4b23cfc7b88817d4240ee571 Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Thu, 23 Sep 2021 10:07:37 +0200 Subject: [PATCH] docs: propose deprecating the global Viper instance Signed-off-by: Mark Sagi-Kazar --- ...unctional-options-during-initialization.md | 2 ++ ...008-deprecate-the-global-viper-instance.md | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docs/adr/0008-deprecate-the-global-viper-instance.md diff --git a/docs/adr/0005-deprecate-setters-in-favor-of-functional-options-during-initialization.md b/docs/adr/0005-deprecate-setters-in-favor-of-functional-options-during-initialization.md index 0993ed3..35f3009 100644 --- a/docs/adr/0005-deprecate-setters-in-favor-of-functional-options-during-initialization.md +++ b/docs/adr/0005-deprecate-setters-in-favor-of-functional-options-during-initialization.md @@ -6,6 +6,8 @@ Date: 2021-07-20 Proposed +Referenced by [8. Deprecate the global Viper instance](0008-deprecate-the-global-viper-instance.md) + ## Context The Viper struct currently acts as a facade for reading, writing and watching configuration for changes. diff --git a/docs/adr/0008-deprecate-the-global-viper-instance.md b/docs/adr/0008-deprecate-the-global-viper-instance.md new file mode 100644 index 0000000..f4be40d --- /dev/null +++ b/docs/adr/0008-deprecate-the-global-viper-instance.md @@ -0,0 +1,23 @@ +# 8. Deprecate the global Viper instance + +Date: 2021-09-23 + +## Status + +Proposed + +References [5. Deprecate setters in favor of functional options during initialization](0005-deprecate-setters-in-favor-of-functional-options-during-initialization.md) + +## Context + +With the deprecation of setters in favor of functional options, it becomes almost impossible to get away with instantiating Viper. +In addition to that, people should be discouraged from accessing a global Viper instance. + +## Decision + +Deprecate the global Viper instance and the global access functions. + +## Consequences + +People will still be able to create a global instance of their own, +but instantiating a custom Viper instance will become the primary solution for using Viper.