public static ExternalModuleCatalog GetCatalog(IOptions <ExternalModuleCatalogOptions> options, LocalStorageModuleCatalog localCatalog) { if (_catalog == null) { var client = new ExternalModulesClient(options); var logger = new LoggerFactory().CreateLogger <ExternalModuleCatalog>(); _catalog = new ExternalModuleCatalog(localCatalog, client, options, logger); _catalog.Load(); } else { _catalog.Reload(); } return(_catalog); }
public static ModuleInstaller GetModuleInstaller(string discoveryPath, string probingPath, string authToken, IEnumerable <string> manifestUrls) { if (_moduleInstaller == null) { var fileManager = new TransactionFileManager(); var fileSystem = new System.IO.Abstractions.FileSystem(); var zipFileWrapper = new ZipFileWrapper(fileSystem, fileManager); var localCatalogOptions = LocalModuleCatalog.GetOptions(discoveryPath, probingPath); var extCatalogOptions = ExtModuleCatalog.GetOptions(authToken, manifestUrls); var localModuleCatalog = LocalModuleCatalog.GetCatalog(localCatalogOptions); var externalModuleCatalog = ExtModuleCatalog.GetCatalog(extCatalogOptions, localModuleCatalog); var modulesClient = new ExternalModulesClient(extCatalogOptions); _moduleInstaller = new ModuleInstaller(externalModuleCatalog, modulesClient, fileManager, localCatalogOptions, fileSystem, zipFileWrapper); } return(_moduleInstaller); }
public static ExternalModuleCatalog GetCatalog(IOptions <ExternalModuleCatalogOptions> options, LocalStorageModuleCatalog localCatalog) { if (_catalog == null) { var platformRelease = GithubManager.GetPlatformRelease(null).GetAwaiter().GetResult(); PlatformVersion.CurrentVersion = new SemanticVersion(Version.Parse(platformRelease.TagName)); // workaround to see all modules in the external catalog var client = new ExternalModulesClient(options); var logger = new LoggerFactory().CreateLogger <ExternalModuleCatalog>(); _catalog = new ExternalModuleCatalog(localCatalog, client, options, logger); _catalog.Load(); } else { _catalog.Reload(); } return(_catalog); }