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.
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/spikard/config.rb', line 364 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 = port @workers = workers @enable_request_id = enable_request_id @max_body_size = max_body_size @request_timeout = request_timeout @compression = compression @rate_limit = rate_limit @jwt_auth = jwt_auth @api_key_auth = api_key_auth @static_files = static_files @graceful_shutdown = graceful_shutdown @shutdown_timeout = shutdown_timeout @openapi = openapi end |
Instance Attribute Details
#api_key_auth ⇒ Object
Returns the value of attribute api_key_auth.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def api_key_auth @api_key_auth end |
#compression ⇒ Object
Returns the value of attribute compression.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def compression @compression end |
#enable_request_id ⇒ Object
Returns the value of attribute enable_request_id.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def enable_request_id @enable_request_id end |
#graceful_shutdown ⇒ Object
Returns the value of attribute graceful_shutdown.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def graceful_shutdown @graceful_shutdown end |
#host ⇒ Object
Returns the value of attribute host.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def host @host end |
#jwt_auth ⇒ Object
Returns the value of attribute jwt_auth.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def jwt_auth @jwt_auth end |
#max_body_size ⇒ Object
Returns the value of attribute max_body_size.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def max_body_size @max_body_size end |
#openapi ⇒ Object
Returns the value of attribute openapi.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def openapi @openapi end |
#port ⇒ Object
Returns the value of attribute port.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def port @port end |
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def rate_limit @rate_limit end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def request_timeout @request_timeout end |
#shutdown_timeout ⇒ Object
Returns the value of attribute shutdown_timeout.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def shutdown_timeout @shutdown_timeout end |
#static_files ⇒ Object
Returns the value of attribute static_files.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def static_files @static_files end |
#workers ⇒ Object
Returns the value of attribute workers.
344 345 346 |
# File 'lib/spikard/config.rb', line 344 def workers @workers end |