public static FunctionMetadataManager GetFunctionMetadataManager(IOptions <ScriptJobHostOptions> jobHostOptions, IFunctionMetadataProvider functionMetadataProvider, IList <IFunctionProvider> functionProviders, IOptions <HttpWorkerOptions> httpOptions, ILoggerFactory loggerFactory, IOptions <LanguageWorkerOptions> languageWorkerOptions) { var managerMock = new Mock <IScriptHostManager>(); return(GetFunctionMetadataManager(jobHostOptions, managerMock, functionMetadataProvider, functionProviders, httpOptions, loggerFactory, languageWorkerOptions)); }
public FunctionMetadataManager(IOptions <ScriptJobHostOptions> scriptOptions, IFunctionMetadataProvider functionMetadataProvider, ILoggerFactory loggerFactory) { _scriptOptions = scriptOptions; _functionMetadataProvider = functionMetadataProvider; _logger = loggerFactory.CreateLogger(LogCategories.Startup); _metadata = new Lazy <ImmutableArray <FunctionMetadata> >(LoadFunctionMetadata); }
public ScriptStartupTypeLocator(string rootScriptPath, ILogger <ScriptStartupTypeLocator> logger, IExtensionBundleManager extensionBundleManager, IFunctionMetadataProvider functionMetadataProvider) { _rootScriptPath = rootScriptPath ?? throw new ArgumentNullException(nameof(rootScriptPath)); _extensionBundleManager = extensionBundleManager ?? throw new ArgumentNullException(nameof(extensionBundleManager)); _logger = logger; _functionMetadataProvider = functionMetadataProvider; }
public FunctionMetadataManager(IOptions <ScriptJobHostOptions> scriptOptions, IFunctionMetadataProvider functionMetadataProvider, IOptions <HttpWorkerOptions> httpWorkerOptions, ILoggerFactory loggerFactory) { _scriptOptions = scriptOptions; _functionMetadataProvider = functionMetadataProvider; _logger = loggerFactory.CreateLogger(LogCategories.Startup); _functionMetadataArray = new Lazy <ImmutableArray <FunctionMetadata> >(LoadFunctionMetadata); _isHttpWorker = httpWorkerOptions.Value.Description != null; }
public AggregateFunctionMetadataProvider( ILogger logger, IFunctionInvocationDispatcher invocationDispatcher, IFunctionMetadataProvider hostFunctionMetadataProvider, IOptions <ScriptJobHostOptions> scriptOptions) { _logger = logger; _dispatcher = invocationDispatcher; _hostFunctionMetadataProvider = hostFunctionMetadataProvider; _scriptOptions = scriptOptions; }
public static FunctionMetadataManager GetFunctionMetadataManager(IOptions <ScriptJobHostOptions> jobHostOptions, Mock <IScriptHostManager> managerMock, IFunctionMetadataProvider functionMetadataProvider, IList <IFunctionProvider> functionProviders, IOptions <HttpWorkerOptions> httpOptions, ILoggerFactory loggerFactory, IOptions <LanguageWorkerOptions> languageWorkerOptions) { managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IEnumerable <IFunctionProvider>))).Returns(functionProviders); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IOptions <ScriptJobHostOptions>))).Returns(jobHostOptions); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IOptions <HttpWorkerOptions>))).Returns(httpOptions); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IOptions <LanguageWorkerOptions>))).Returns(languageWorkerOptions); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(ILoggerFactory))).Returns(loggerFactory); return(new FunctionMetadataManager(jobHostOptions, functionMetadataProvider, functionProviders, httpOptions, managerMock.Object, loggerFactory, languageWorkerOptions)); }
public WebFunctionsManager(IOptionsMonitor <ScriptApplicationHostOptions> applicationHostOptions, IOptions <LanguageWorkerOptions> languageWorkerOptions, ILoggerFactory loggerFactory, HttpClient client, ISecretManagerProvider secretManagerProvider, IFunctionsSyncManager functionsSyncManager, HostNameProvider hostNameProvider, IFunctionMetadataProvider functionMetadataProvider) { _applicationHostOptions = applicationHostOptions; _logger = loggerFactory?.CreateLogger(ScriptConstants.LogCategoryHostGeneral); _client = client; _workerConfigs = languageWorkerOptions.Value.WorkerConfigs; _secretManagerProvider = secretManagerProvider; _functionsSyncManager = functionsSyncManager; _hostNameProvider = hostNameProvider; _functionMetadataProvider = functionMetadataProvider; }
public FunctionsSyncManager(IConfiguration configuration, IHostIdProvider hostIdProvider, IOptionsMonitor <ScriptApplicationHostOptions> applicationHostOptions, ILogger <FunctionsSyncManager> logger, HttpClient httpClient, ISecretManagerProvider secretManagerProvider, IScriptWebHostEnvironment webHostEnvironment, IEnvironment environment, HostNameProvider hostNameProvider, IFunctionMetadataProvider functionMetadataProvider) { _applicationHostOptions = applicationHostOptions; _logger = logger; _httpClient = httpClient; _secretManagerProvider = secretManagerProvider; _configuration = configuration; _hostIdProvider = hostIdProvider; _webHostEnvironment = webHostEnvironment; _environment = environment; _hostNameProvider = hostNameProvider; _functionMetadataProvider = functionMetadataProvider; }
public FunctionMetadataManager(IOptions <ScriptJobHostOptions> scriptOptions, IFunctionMetadataProvider functionMetadataProvider, IOptions <HttpWorkerOptions> httpWorkerOptions, IScriptHostManager scriptHostManager, ILoggerFactory loggerFactory, IOptions <LanguageWorkerOptions> languageWorkerOptions) { _scriptOptions = scriptOptions; _languageWorkerOptions = languageWorkerOptions; _serviceProvider = scriptHostManager as IServiceProvider; _functionMetadataProvider = functionMetadataProvider; _logger = loggerFactory.CreateLogger(LogCategories.Startup); _isHttpWorker = httpWorkerOptions?.Value?.Description != null; // Every time script host is re-intializing, we also need to re-initialize // services that change with the scope of the script host. scriptHostManager.HostInitializing += (s, e) => { InitializeServices(); }; }
public static FunctionMetadataManager GetFunctionMetadataManager(IOptions <ScriptJobHostOptions> jobHostOptions, Mock <IScriptHostManager> managerMock, IFunctionMetadataProvider functionMetadataProvider, IList <IFunctionProvider> functionProviders, IOptions <HttpWorkerOptions> httpOptions, ILoggerFactory loggerFactory, IOptions <LanguageWorkerOptions> languageWorkerOptions) { managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IEnumerable <IFunctionProvider>))).Returns(functionProviders); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IOptions <ScriptJobHostOptions>))).Returns(jobHostOptions); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IOptions <HttpWorkerOptions>))).Returns(httpOptions); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(IOptions <LanguageWorkerOptions>))).Returns(languageWorkerOptions); managerMock.As <IServiceProvider>().Setup(m => m.GetService(typeof(ILoggerFactory))).Returns(loggerFactory); var options = new ScriptApplicationHostOptions() { IsSelfHost = true, ScriptPath = TestHelpers.FunctionsTestDirectory, LogPath = TestHelpers.GetHostLogFileDirectory().FullName }; var factory = new TestOptionsFactory <ScriptApplicationHostOptions>(options); var source = new TestChangeTokenSource <ScriptApplicationHostOptions>(); var changeTokens = new[] { source }; var optionsMonitor = new OptionsMonitor <ScriptApplicationHostOptions>(factory, changeTokens, factory); return(new FunctionMetadataManager(jobHostOptions, functionMetadataProvider, httpOptions, managerMock.Object, loggerFactory, languageWorkerOptions, SystemEnvironment.Instance)); }
public static FunctionMetadataManager GetFunctionMetadataManager(IOptions <ScriptJobHostOptions> jobHostOptions, IFunctionMetadataProvider functionMetadataProvider, IOptions <HttpWorkerOptions> httpOptions, ILoggerFactory loggerFactory, IOptions <LanguageWorkerOptions> languageWorkerOptions) { return(GetFunctionMetadataManager(jobHostOptions, functionMetadataProvider, new List <IFunctionProvider>(), httpOptions, loggerFactory, languageWorkerOptions)); }