[#1770] node: Refactor application configuration

Split all the fields in `cfg` structure on:
1. `applicationConfiguration`;
2. `internals`; // shared entities for an application work, such as
`context.Context`
3. `shared`; // holder for the shared entities b/w;
4. `cfgXXX`; // configuration for internal services.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-09-27 16:13:49 +03:00 committed by LeL
parent 713aea06fa
commit 01ddb3f8e6
2 changed files with 85 additions and 88 deletions

View file

@ -255,7 +255,7 @@ func initObjectService(c *cfg) {
var os putsvc.ObjectStorage = engineWithoutNotifications{
e: ls,
state: c,
state: &c.internals,
}
if c.cfgNotifications.enabled {
@ -291,7 +291,7 @@ func initObjectService(c *cfg) {
sSearch := searchsvc.New(
searchsvc.WithLogger(c.log),
searchsvc.WithLocalStorageEngine(ls, c),
searchsvc.WithLocalStorageEngine(ls, &c.internals),
searchsvc.WithClientConstructor(coreConstructor),
searchsvc.WithTraverserGenerator(
traverseGen.WithTraverseOptions(
@ -318,7 +318,7 @@ func initObjectService(c *cfg) {
),
getsvc.WithNetMapSource(c.netMapSource),
getsvc.WithKeyStorage(keyStorage),
getsvc.WithNodeState(c),
getsvc.WithNodeState(&c.internals),
)
*c.cfgObject.getSvc = *sGet // need smth better