Class: Nonnative::ConfigurationProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/nonnative/configuration_proxy.rb

Overview

Proxy configuration attached to a runner configuration.

A proxy allows you to interpose behavior between a client and a real service. For example, the built-in ‘“fault_injection”` proxy can close connections, introduce delays, or corrupt data for resilience testing.

This object is created automatically for each runner via ConfigurationRunner. When ‘kind` is set to `“none”`, no proxy is started and the runner will use its configured `host`/`port` directly.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializevoid

Creates a proxy configuration with defaults.

Defaults:

  • ‘kind`: `“none”`

  • ‘host`: `“0.0.0.0”`

  • ‘port`: `0`

  • ‘wait`: `0.1`

  • ‘options`: `{}`



36
37
38
39
40
41
42
# File 'lib/nonnative/configuration_proxy.rb', line 36

def initialize
  self.kind = 'none'
  self.host = '0.0.0.0'
  self.port = 0
  self.wait = 0.1
  self.options = {}
end

Instance Attribute Details

#hostString, ...

Returns:

  • (String)

    proxy kind name (for example ‘“none”` or `“fault_injection”`)

  • (String)

    proxy bind host (defaults to ‘“0.0.0.0”`)

  • (Integer)

    proxy bind port (defaults to ‘0`)

  • (String, nil)

    path to proxy log file (implementation-dependent)

  • (Numeric)

    wait interval (seconds) after proxy state changes (defaults to ‘0.1`)

  • (Hash)

    proxy implementation options (implementation-dependent)



23
24
25
# File 'lib/nonnative/configuration_proxy.rb', line 23

def host
  @host
end

#kindString, ...

Returns:

  • (String)

    proxy kind name (for example ‘“none”` or `“fault_injection”`)

  • (String)

    proxy bind host (defaults to ‘“0.0.0.0”`)

  • (Integer)

    proxy bind port (defaults to ‘0`)

  • (String, nil)

    path to proxy log file (implementation-dependent)

  • (Numeric)

    wait interval (seconds) after proxy state changes (defaults to ‘0.1`)

  • (Hash)

    proxy implementation options (implementation-dependent)



23
24
25
# File 'lib/nonnative/configuration_proxy.rb', line 23

def kind
  @kind
end

#logString, ...

Returns:

  • (String)

    proxy kind name (for example ‘“none”` or `“fault_injection”`)

  • (String)

    proxy bind host (defaults to ‘“0.0.0.0”`)

  • (Integer)

    proxy bind port (defaults to ‘0`)

  • (String, nil)

    path to proxy log file (implementation-dependent)

  • (Numeric)

    wait interval (seconds) after proxy state changes (defaults to ‘0.1`)

  • (Hash)

    proxy implementation options (implementation-dependent)



23
24
25
# File 'lib/nonnative/configuration_proxy.rb', line 23

def log
  @log
end

#optionsObject

Returns the value of attribute options.



24
25
26
# File 'lib/nonnative/configuration_proxy.rb', line 24

def options
  @options
end

#portString, ...

Returns:

  • (String)

    proxy kind name (for example ‘“none”` or `“fault_injection”`)

  • (String)

    proxy bind host (defaults to ‘“0.0.0.0”`)

  • (Integer)

    proxy bind port (defaults to ‘0`)

  • (String, nil)

    path to proxy log file (implementation-dependent)

  • (Numeric)

    wait interval (seconds) after proxy state changes (defaults to ‘0.1`)

  • (Hash)

    proxy implementation options (implementation-dependent)



23
24
25
# File 'lib/nonnative/configuration_proxy.rb', line 23

def port
  @port
end

#waitString, ...

Returns:

  • (String)

    proxy kind name (for example ‘“none”` or `“fault_injection”`)

  • (String)

    proxy bind host (defaults to ‘“0.0.0.0”`)

  • (Integer)

    proxy bind port (defaults to ‘0`)

  • (String, nil)

    path to proxy log file (implementation-dependent)

  • (Numeric)

    wait interval (seconds) after proxy state changes (defaults to ‘0.1`)

  • (Hash)

    proxy implementation options (implementation-dependent)



23
24
25
# File 'lib/nonnative/configuration_proxy.rb', line 23

def wait
  @wait
end