Ejemplo n.º 1
0
        /// <summary>
        /// Configures component by passing configuration parameters.
        /// </summary>
        /// <param name="config">configuration parameters to be set.</param>
        public virtual void Configure(ConfigParams config)
        {
            _config = config.SetDefaults(_defaultConfig);
            _dependencyResolver.Configure(config);

            _baseRoute = config.GetAsStringWithDefault("base_route", _baseRoute);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Configures component by passing configuration parameters.
        /// </summary>
        /// <param name="config">configuration parameters to be set.</param>
        public virtual void Configure(ConfigParams config)
        {
            _config = config.SetDefaults(_defaultConfig);
            _dependencyResolver.Configure(config);

            _serviceName = config.GetAsStringWithDefault("service_name", _serviceName);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Configures component by passing configuration parameters.
        /// </summary>
        /// <param name="config">configuration parameters to be set.</param>
        public virtual void Configure(ConfigParams config)
        {
            _config = config.SetDefaults(_defaultConfig);
            _dependencyResolver.Configure(_config);

            _collectionName = config.GetAsStringWithDefault("collection", _collectionName);
        }
        /// <summary>
        /// Configures this HttpEndpoint using the given configuration parameters.
        ///
        /// __Configuration parameters:__ - __connection(s)__ - the connection resolver's
        /// connections; - "connection.discovery_key" - the key to use for connection
        /// resolving in a discovery service; - "connection.protocol" - the connection's
        /// protocol; - "connection.host" - the target host; - "connection.port" - the
        /// target port; - "connection.uri" - the target URI.
        /// </summary>
        /// <param name="config">configuration parameters, containing a "connection(s)" section.</param>
        /// See <see cref="ConfigParams"/>
        public virtual void Configure(ConfigParams config)
        {
            config = config.SetDefaults(_defaultConfig);
            _dependencyResolver.Configure(config);
            _connectionResolver.Configure(config);

            _maintenanceEnabled  = config.GetAsBooleanWithDefault("options.maintenance_enabled", _maintenanceEnabled);
            _fileMaxSize         = config.GetAsLongWithDefault("options.file_max_size", _fileMaxSize);
            _responseCompression = config.GetAsBooleanWithDefault("options.response_compression", _responseCompression);

            var headers = config.GetAsStringWithDefault("cors_headers", "").Split(',');

            foreach (var header in headers.Where(h => !string.IsNullOrWhiteSpace(h)))
            {
                var h = header.Trim();
                if (!_allowedHeaders.Contains(h))
                {
                    _allowedHeaders.Add(h);
                }
            }

            var origins = config.GetAsStringWithDefault("cors_origins", "").Split(',');

            foreach (var origin in origins.Where(o => !string.IsNullOrWhiteSpace(o)))
            {
                var o = origin.Trim();
                if (!_allowedOrigins.Contains(o))
                {
                    _allowedOrigins.Add(o);
                }
            }
        }
        /// <summary>
        /// Configures component by passing configuration parameters.
        /// </summary>
        /// <param name="config">configuration parameters to be set.</param>
        public virtual void Configure(ConfigParams config)
        {
            _config = config.SetDefaults(_defaultConfig);
            _dependencyResolver.Configure(_config);

            _collectionName = config.GetAsStringWithDefault("collection", _collectionName);
            _maxPageSize    = config.GetAsIntegerWithDefault("options.max_page_size", _maxPageSize);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Configures this HttpEndpoint using the given configuration parameters.
        ///
        /// __Configuration parameters:__ - __connection(s)__ - the connection resolver's
        /// connections; - "connection.discovery_key" - the key to use for connection
        /// resolving in a discovery service; - "connection.protocol" - the connection's
        /// protocol; - "connection.host" - the target host; - "connection.port" - the
        /// target port; - "connection.uri" - the target URI.
        /// </summary>
        /// <param name="config">configuration parameters, containing a "connection(s)" section.</param>
        /// See <see cref="ConfigParams"/>
        public virtual void Configure(ConfigParams config)
        {
            config = config.SetDefaults(_defaultConfig);
            _dependencyResolver.Configure(config);
            _connectionResolver.Configure(config);

            _maintenanceEnabled  = config.GetAsBooleanWithDefault("options.maintenance_enabled", _maintenanceEnabled);
            _fileMaxSize         = config.GetAsLongWithDefault("options.file_max_size", _fileMaxSize);
            _responseCompression = config.GetAsBooleanWithDefault("options.response_compression", _responseCompression);
        }
        /// <summary>
        /// Configures component by passing configuration parameters.
        /// </summary>
        /// <param name="config">configuration parameters to be set.</param>
        public virtual void Configure(ConfigParams config)
        {
            _config = config.SetDefaults(_defaultConfig);
            _dependencyResolver.Configure(config);

            _baseRoute = config.GetAsStringWithDefault("base_route", _baseRoute);

            _swaggerEnable = config.GetAsBooleanWithDefault("swagger.enable", _swaggerEnable);
            _swaggerRoute  = config.GetAsStringWithDefault("swagger.route", _swaggerRoute);
        }
        /// <summary>
        /// Configure are configures component by passing configuration parameters.
        /// </summary>
        /// <param name="config">Configuration parameters to be set</param>
        public override void Configure(ConfigParams config)
        {
            base.Configure(config);
            _dependencyResolver.Configure(config);

            _config = config;

            _subject    = config.GetAsStringWithDefault("topic", _subject);
            _subject    = config.GetAsStringWithDefault("subject", _subject);
            _queueGroup = config.GetAsStringWithDefault("group", _queueGroup);
            _queueGroup = config.GetAsStringWithDefault("queue_group", _queueGroup);
        }
        /// <summary>
        /// Configure are configures component by passing configuration parameters.
        /// </summary>
        /// <param name="config">Configuration parameters to be set</param>
        public override void Configure(ConfigParams config)
        {
            base.Configure(config);
            _dependencyResolver.Configure(config);

            _config = config;

            _topic             = config.GetAsStringWithDefault("topic", _topic);
            _serializeEnvelope = config.GetAsBooleanWithDefault("options.serialize_envelope", _serializeEnvelope);
            _retain            = config.GetAsBooleanWithDefault("options.retain", _retain);
            _qos = config.GetAsIntegerWithDefault("options.qos", _qos);
        }
 /// <summary>
 /// Configures component by passing configuration parameters.
 /// </summary>
 /// <param name="config">configuration parameters to be set.</param>
 public virtual void Configure(ConfigParams config)
 {
     _dependencyResolver.Configure(config);
 }
 /// <summary>
 /// Configures this HttpEndpoint using the given configuration parameters.
 ///
 /// __Configuration parameters:__ - __connection(s)__ - the connection resolver's
 /// connections; - "connection.discovery_key" - the key to use for connection
 /// resolving in a discovery service; - "connection.protocol" - the connection's
 /// protocol; - "connection.host" - the target host; - "connection.port" - the
 /// target port; - "connection.uri" - the target URI.
 /// </summary>
 /// <param name="config">configuration parameters, containing a "connection(s)" section.</param>
 /// See <see cref="ConfigParams"/>
 public virtual void Configure(ConfigParams config)
 {
     config = config.SetDefaults(_defaultConfig);
     _dependencyResolver.Configure(config);
     _connectionResolver.Configure(config);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Configures component by passing configuration parameters.
 /// </summary>
 /// <param name="config">configuration parameters to be set.</param>
 public void Configure(ConfigParams config)
 {
     _dependencyResolver.Configure(config);
     _logger.Configure(config);
 }