multi: refactor external subserver config

As a preparation for making more and more implementation details
configurable, we add a new ImplementationCfg struct that houses all the
interfaces that can be defined externally.
This commit is contained in:
Oliver Gugger committed 2021-10-08 12:08:23 +02:00
1 parent 140d5a8086
commit 0e279eb15a
6 files changed
+165 -113

No files matched your search

+11
View File
@@ -1536,6 +1536,17 @@ func (c *Config) graphDatabaseDir() string {
)
}
// ImplementationConfig returns the configuration of what actual implementations
// should be used when creating the main lnd instance.
func (c *Config) ImplementationConfig() *ImplementationCfg {
defaultImpl := &DefaultWalletImpl{}
return &ImplementationCfg{
GrpcRegistrar: defaultImpl,
RestRegistrar: defaultImpl,
ExternalValidator: defaultImpl,
}
}
// CleanAndExpandPath expands environment variables and leading ~ in the
// passed path, cleans the result, and returns it.
// This function is taken from https://github.com/btcsuite/btcd