Ejemplo n.º 1
0
 internal JsonPluginEndPoint(PluginFeature pluginFeature, string name, PluginsModule pluginsModule, Func <T, object?> responseRequestHandler) : base(pluginFeature, name, pluginsModule)
 {
     _responseRequestHandler = responseRequestHandler;
     ThrowOnFail             = true;
     Accepts = MimeType.Json;
     Returns = MimeType.Json;
 }
        internal DataModelJsonPluginEndPoint(Module <T> module, string name, PluginsModule pluginsModule) : base(module, name, pluginsModule)
        {
            _module = module ?? throw new ArgumentNullException(nameof(module));

            ThrowOnFail = true;
            Accepts     = MimeType.Json;
        }
Ejemplo n.º 3
0
        internal PluginEndPoint(PluginFeature pluginFeature, string name, PluginsModule pluginsModule)
        {
            _pluginsModule = pluginsModule;
            PluginFeature  = pluginFeature;
            Name           = name;

            PluginFeature.Disabled += OnDisabled;
        }
Ejemplo n.º 4
0
        public WebServerService(IKernel kernel, ILogger logger, ISettingsService settingsService)
        {
            _kernel      = kernel;
            _logger      = logger;
            _controllers = new List <WebApiControllerRegistration>();

            _webServerPortSetting = settingsService.GetSetting("WebServer.Port", 9696);
            _webServerPortSetting.SettingChanged += WebServerPortSettingOnSettingChanged;

            PluginsModule = new PluginsModule("/plugins");
            StartWebServer();
        }
Ejemplo n.º 5
0
        public WebServerService(ILogger logger, ISettingsService settingsService, IPluginManagementService pluginManagementService)
        {
            _logger      = logger;
            _controllers = new List <WebApiControllerRegistration>();
            _modules     = new List <WebModuleRegistration>();

            _webServerPortSetting = settingsService.GetSetting("WebServer.Port", 9696);
            _webServerPortSetting.SettingChanged          += WebServerPortSettingOnSettingChanged;
            pluginManagementService.PluginFeatureDisabled += PluginManagementServiceOnPluginFeatureDisabled;

            PluginsModule = new PluginsModule("/plugins");
            StartWebServer();
        }
Ejemplo n.º 6
0
 /// <inheritdoc />
 internal RawPluginEndPoint(PluginFeature pluginFeature, string name, PluginsModule pluginsModule, Func <IHttpContext, Task> requestHandler) : base(pluginFeature, name, pluginsModule)
 {
     RequestHandler = requestHandler;
 }
Ejemplo n.º 7
0
 internal JsonPluginEndPoint(PluginFeature pluginFeature, string name, PluginsModule pluginsModule, Action <T> requestHandler) : base(pluginFeature, name, pluginsModule)
 {
     _requestHandler = requestHandler;
     ThrowOnFail     = true;
     Accepts         = MimeType.Json;
 }
        internal DataModelJsonPluginEndPoint(DataModelExpansion <T> dataModelExpansion, string name, PluginsModule pluginsModule) : base(dataModelExpansion, name, pluginsModule)
        {
            _dataModelExpansion = dataModelExpansion ?? throw new ArgumentNullException(nameof(dataModelExpansion));

            ThrowOnFail = true;
            Accepts     = MimeType.Json;
        }
Ejemplo n.º 9
0
 internal StringPluginEndPoint(PluginFeature pluginFeature, string name, PluginsModule pluginsModule, Func <string, string?> requestHandler) : base(pluginFeature, name, pluginsModule)
 {
     _responseRequestHandler = requestHandler;
     Accepts = MimeType.PlainText;
     Returns = MimeType.PlainText;
 }
Ejemplo n.º 10
0
 internal StringPluginEndPoint(PluginFeature pluginFeature, string name, PluginsModule pluginsModule, Action <string> requestHandler) : base(pluginFeature, name, pluginsModule)
 {
     _requestHandler = requestHandler;
     Accepts         = MimeType.PlainText;
 }