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.
-
#additional_http_filters ⇒ Object
Returns the value of attribute additional_http_filters.
-
#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
112 113 114 |
# File 'lib/kumonos/envoy.rb', line 112 def access_log_path @access_log_path end |
#additional_http_filters ⇒ Object
Returns the value of attribute additional_http_filters
112 113 114 |
# File 'lib/kumonos/envoy.rb', line 112 def additional_http_filters @additional_http_filters end |
#address ⇒ Object
Returns the value of attribute address
112 113 114 |
# File 'lib/kumonos/envoy.rb', line 112 def address @address end |
#discovery_service ⇒ Object
Returns the value of attribute discovery_service
112 113 114 |
# File 'lib/kumonos/envoy.rb', line 112 def discovery_service @discovery_service end |
Class Method Details
.build(h, discovery_service) ⇒ Object
114 115 116 117 |
# File 'lib/kumonos/envoy.rb', line 114 def build(h, discovery_service) address = AddressParser.call(h.fetch('address')) new(address, h.fetch('access_log_path'), discovery_service, h['additional_http_filters']) end |
Instance Method Details
#to_h ⇒ Object
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 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/kumonos/envoy.rb', line 120 def to_h h = super h.delete(:discovery_service) h.delete(:access_log_path) h.delete(:additional_http_filters) http_filters = (additional_http_filters || []) + DEFAULT_HTTP_FILTERS 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: http_filters } } ] } ] h end |