Exemplo n.º 1
0
 public WebServer(ILifetimeScope scope, ISettingStore settingStore, ILogger logger)
 {
     _scope             = scope;
     _logger            = logger.ForContext <WebServer>();
     _httpServerEnabled = settingStore.GetOrSet("HttpServerEnabled", true, $"Is the Papercut Web UI Server enabled (Defaults to true)?");
     _httpBaseAddress   = settingStore.GetOrSet("HttpBaseAddress", DefaultHttpBaseAddress, $"The Papercut Web UI Server listening address (Defaults to {DefaultHttpBaseAddress}).");
     _httpPort          = settingStore.GetOrSet("HttpPort", DefaultHttpPort, $"The Papercut Web UI Server listening port (Defaults to {DefaultHttpPort}).");
 }
Exemplo n.º 2
0
        public PapercutIPCommEndpoints([NotNull] ISettingStore settingStore)
        {
            if (settingStore == null)
            {
                throw new ArgumentNullException(nameof(settingStore));
            }

            var uiAddress = settingStore.GetOrSet("IPCommUIAddress", PapercutIPCommConstants.Localhost,
                                                  $"The IP Comm UI IP address (Defaults to {PapercutIPCommConstants.Localhost}).");

            var uiPort = settingStore.GetOrSet("IPCommUIPort", PapercutIPCommConstants.UiListeningPort,
                                               $"The IP Comm UI listening port (Defaults to {PapercutIPCommConstants.UiListeningPort}).");

            this.UI = new EndpointDefinition(uiAddress, uiPort);

            var serviceAddress = settingStore.GetOrSet("IPCommServiceAddress", PapercutIPCommConstants.Localhost,
                                                       $"The IP Comm Service IP address (Defaults to {PapercutIPCommConstants.Localhost}).");

            var servicePort = settingStore.GetOrSet("IPCommServicePort", PapercutIPCommConstants.ServiceListeningPort,
                                                    $"The IP Comm Service UI listening port (Defaults to {PapercutIPCommConstants.ServiceListeningPort}).");

            this.Service = new EndpointDefinition(serviceAddress, servicePort);
        }
Exemplo n.º 3
0
 public static T GetOrSet <T>(this ISettingStore settings, string key, T defaultValue, string description)
 {
     return(settings.GetOrSet(key, () => defaultValue, description));
 }
Exemplo n.º 4
0
 public WebServer(ILifetimeScope scope, ISettingStore settingStore, ILogger logger)
 {
     this._scope    = scope;
     this._logger   = logger.ForContext <WebServer>();
     this._httpPort = settingStore.GetOrSet("HttpPort", DefaultHttpPort, $"The Http Web UI Server listening port (Defaults to {DefaultHttpPort}).");
 }