Class: Kumonos::Envoy::Listener
- Inherits:
-
Struct
- Object
- Struct
- Kumonos::Envoy::Listener
- Defined in:
- lib/kumonos/envoy.rb
Instance Attribute Summary collapse
-
#access_log_path ⇒ Object
Returns the value of attribute access_log_path.
-
#address ⇒ Object
Returns the value of attribute address.
-
#discovery_service ⇒ Object
Returns the value of attribute discovery_service.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#access_log_path ⇒ Object
Returns the value of attribute access_log_path
105 106 107 |
# File 'lib/kumonos/envoy.rb', line 105 def access_log_path @access_log_path end |
#address ⇒ Object
Returns the value of attribute address
105 106 107 |
# File 'lib/kumonos/envoy.rb', line 105 def address @address end |
#discovery_service ⇒ Object
Returns the value of attribute discovery_service
105 106 107 |
# File 'lib/kumonos/envoy.rb', line 105 def discovery_service @discovery_service end |
Class Method Details
.build(h, discovery_service) ⇒ Object
107 108 109 110 |
# File 'lib/kumonos/envoy.rb', line 107 def build(h, discovery_service) address = AddressParser.call(h.fetch('address')) new(address, h.fetch('access_log_path'), discovery_service) end |
Instance Method Details
#to_h ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/kumonos/envoy.rb', line 113 def to_h h = super h.delete(:discovery_service) h.delete(:access_log_path) h[:name] = 'egress' h[:filter_chains] = [ { filters: [ { name: 'envoy.http_connection_manager', config: { codec_type: 'AUTO', stat_prefix: 'egress_http', access_log: [ { name: 'envoy.file_access_log', config: { path: access_log_path } } ], rds: { config_source: { api_config_source: { cluster_names: [discovery_service.cluster.name], refresh_delay: { seconds: discovery_service.refresh_delay_ms / 1000.0 } } }, route_config_name: DEFAULT_ROUTE_NAME }, http_filters: [{ name: 'envoy.router' }] } } ] } ] h end |