conf: enable dependency injection of site-config accessing to reduce use of global accessors
Created by: Strum355
This PR primarily introduces these changes:
- Creates
SiteConfig()
andServiceConnections()
methods oninternal/conf.(*client)
andinternal/conf.Unified
- Creates commonly-used interfaces for (a subset of) the methods of
internal/conf.(*client)
and forinternal/conf.Unified
- Makes
internal/conf.(*client)
a type designed to be passed around by exportinginternal/conf.DefaultClient()
a. This reduces the reliance on theinternal/conf
package which has reliance on other widely used packages, instead shifting the reliance onto the (almost) interface-onlyinternal/conf/conftypes
b. It is expected that a config-type interface from point 2 is passed down the stacks rather than relying on the globalinternal/conf.Get()
- Replaces use of
internal/conf.Get()
with calls to a passed-downinternal/conf.(*client)
in a select few areas. a. Other teams can adopt this at their own pace and to the extent they see suitable
This pattern should also allow for moving away from the existing format of mocking site-config once adoption is far enough.
NOTE: all names are subject to change. Please leave your name recommendations if you'd prefer different names.