Class: Spikard::ServerConfig
- Inherits:
-
Object
- Object
- Spikard::ServerConfig
- Defined in:
- lib/spikard/config.rb
Overview
Complete server configuration for Spikard.
This is the main configuration object that controls all aspects of the server including network settings, middleware, authentication, and more.
Instance Attribute Summary collapse
-
#api_key_auth ⇒ Object
Returns the value of attribute api_key_auth.
-
#compression ⇒ Object
Returns the value of attribute compression.
-
#enable_request_id ⇒ Object
Returns the value of attribute enable_request_id.
-
#graceful_shutdown ⇒ Object
Returns the value of attribute graceful_shutdown.
-
#host ⇒ Object
Returns the value of attribute host.
-
#jwt_auth ⇒ Object
Returns the value of attribute jwt_auth.
-
#max_body_size ⇒ Object
Returns the value of attribute max_body_size.
-
#openapi ⇒ Object
Returns the value of attribute openapi.
-
#port ⇒ Object
Returns the value of attribute port.
-
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#shutdown_timeout ⇒ Object
Returns the value of attribute shutdown_timeout.
-
#static_files ⇒ Object
Returns the value of attribute static_files.
-
#workers ⇒ Object
Returns the value of attribute workers.
Instance Method Summary collapse
-
#initialize(host: '127.0.0.1', port: 8000, workers: 1, enable_request_id: true, max_body_size: 10 * 1024 * 1024, request_timeout: 30, compression: CompressionConfig.new, rate_limit: nil, jwt_auth: nil, api_key_auth: nil, static_files: [], graceful_shutdown: true, shutdown_timeout: 30, openapi: nil) ⇒ ServerConfig
constructor
A new instance of ServerConfig.
Constructor Details
#initialize(host: '127.0.0.1', port: 8000, workers: 1, enable_request_id: true, max_body_size: 10 * 1024 * 1024, request_timeout: 30, compression: CompressionConfig.new, rate_limit: nil, jwt_auth: nil, api_key_auth: nil, static_files: [], graceful_shutdown: true, shutdown_timeout: 30, openapi: nil) ⇒ ServerConfig
Returns a new instance of ServerConfig.
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/spikard/config.rb', line 388 def initialize( host: '127.0.0.1', port: 8000, workers: 1, enable_request_id: true, max_body_size: 10 * 1024 * 1024, # 10MB request_timeout: 30, compression: CompressionConfig.new, rate_limit: nil, jwt_auth: nil, api_key_auth: nil, static_files: [], graceful_shutdown: true, shutdown_timeout: 30, openapi: nil ) @host = host @port = normalize_port(port) @workers = normalize_workers(workers) @enable_request_id = normalize_boolean('enable_request_id', enable_request_id) @max_body_size = normalize_optional_nonnegative_integer('max_body_size', max_body_size) @request_timeout = normalize_timeout('request_timeout', request_timeout) @compression = compression @rate_limit = rate_limit @jwt_auth = jwt_auth @api_key_auth = api_key_auth @static_files = normalize_static_files(static_files) @graceful_shutdown = normalize_boolean('graceful_shutdown', graceful_shutdown) @shutdown_timeout = normalize_timeout('shutdown_timeout', shutdown_timeout) @openapi = openapi end |
Instance Attribute Details
#api_key_auth ⇒ Object
Returns the value of attribute api_key_auth.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def api_key_auth @api_key_auth end |
#compression ⇒ Object
Returns the value of attribute compression.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def compression @compression end |
#enable_request_id ⇒ Object
Returns the value of attribute enable_request_id.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def enable_request_id @enable_request_id end |
#graceful_shutdown ⇒ Object
Returns the value of attribute graceful_shutdown.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def graceful_shutdown @graceful_shutdown end |
#host ⇒ Object
Returns the value of attribute host.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def host @host end |
#jwt_auth ⇒ Object
Returns the value of attribute jwt_auth.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def jwt_auth @jwt_auth end |
#max_body_size ⇒ Object
Returns the value of attribute max_body_size.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def max_body_size @max_body_size end |
#openapi ⇒ Object
Returns the value of attribute openapi.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def openapi @openapi end |
#port ⇒ Object
Returns the value of attribute port.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def port @port end |
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def rate_limit @rate_limit end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def request_timeout @request_timeout end |
#shutdown_timeout ⇒ Object
Returns the value of attribute shutdown_timeout.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def shutdown_timeout @shutdown_timeout end |
#static_files ⇒ Object
Returns the value of attribute static_files.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def static_files @static_files end |
#workers ⇒ Object
Returns the value of attribute workers.
368 369 370 |
# File 'lib/spikard/config.rb', line 368 def workers @workers end |