Class: Nanobot::Config::GatewayConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/nanobot/config/schema.rb

Overview

HTTP Gateway channel configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: false, host: '127.0.0.1', port: 18_790, auth_token: nil) ⇒ GatewayConfig

Returns a new instance of GatewayConfig.

Parameters:

  • enabled (Boolean) (defaults to: false) —

    whether the HTTP gateway is active

  • host (String) (defaults to: '127.0.0.1') —

    bind address for the HTTP server

  • port (Integer) (defaults to: 18_790) —

    listen port for the HTTP server

  • auth_token (String, nil) (defaults to: nil) —

    bearer token for authenticating requests



149
150
151
# File 'lib/nanobot/config/schema.rb', line 149

def initialize(enabled: false, host: '127.0.0.1', port: 18_790, auth_token: nil)
  super
end

Instance Attribute Details

#auth_token ⇒ Object

Returns the value of attribute auth_token

Returns:

  • (Object) —

    the current value of auth_token



144
145
146
# File 'lib/nanobot/config/schema.rb', line 144

def auth_token
  @auth_token
end

#enabled ⇒ Object

Returns the value of attribute enabled

Returns:

  • (Object) —

    the current value of enabled



144
145
146
# File 'lib/nanobot/config/schema.rb', line 144

def enabled
  @enabled
end

#host ⇒ Object

Returns the value of attribute host

Returns:

  • (Object) —

    the current value of host



144
145
146
# File 'lib/nanobot/config/schema.rb', line 144

def host
  @host
end

#port ⇒ Object

Returns the value of attribute port

Returns:

  • (Object) —

    the current value of port



144
145
146
# File 'lib/nanobot/config/schema.rb', line 144

def port
  @port
end