wayfarer/documentation/dsls/DSL:-Wayfarer.md
Renovate Bot e4224a0daf
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
chore(deps): update dependency spark to v2
2024-03-03 20:13:16 +13:00

888 lines
22 KiB
Markdown

<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: Wayfarer.Dsl
The Wayfarer DSL for defining static proxy configurations.
## DSL options
## wayfarer
* [config](#module-config)
* health_checks
* check
* host_patterns
* pattern
* listeners
* http
* https
* targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
---
### config
* health_checks
* check
* host_patterns
* pattern
* listeners
* http
* https
* targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
* `:name` (`t:String.t/0`) -
##### health_checks
* check
###### check
* `:name` - A unique name for the health check.
* `:method` - The HTTP method to use for the request. Valid values are :get, :head, :post, :put, :delete, :connect, :options, :trace, :patch The default value is `:get`.
* `:connect_timeout` (`t:pos_integer/0`) - Connection timeout in milliseconds The default value is `5000`.
* `:response_timeout` (`t:pos_integer/0`) - Response timeout in milliseconds The default value is `500`.
* `:hostname` - The HTTP hostname to use when sending the request. Defaults to the IP address.
* `:interval` (`t:pos_integer/0`) - Interval in milliseconds The default value is `30000`.
* `:threshold` (`t:pos_integer/0`) - Success threshold The default value is `3`.
* `:path` (`t:String.t/0`) - Path The default value is `"/"`.
* `:success_codes` (one or a list of struct of type `Range`) - HTTP status codes which are considered successful. The default value is `[200..299]`.
##### host_patterns
* pattern
###### pattern
* `:pattern` (`t:String.t/0`) - Required. A hostname matching pattern.
##### listeners
* http
* https
###### http
* `:scheme` - Required. The listening protocol. Valid values are :http, :https
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the listener (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
* `:http_1_options` (`t:keyword/0`) - Options to configure the HTTP/1 stack in Bandit. The default value is `[]`.
* `:http_2_options` (`t:keyword/0`) - Options to configure the HTTP/2 stack in Bandit. The default value is `[]`.
* `:thousand_island_options` (`t:keyword/0`) - Possible options to configure a ThousandIsland server. The default value is `[]`.
* `:websocket_options` (`t:keyword/0`) - Options to configure the WebSocket stack in Bandit. The default value is `[]`.
###### https
* `:scheme` - Required. The listening protocol. Valid values are :http, :https
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the listener (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
* `:http_1_options` (`t:keyword/0`) - Options to configure the HTTP/1 stack in Bandit. The default value is `[]`.
* `:http_2_options` (`t:keyword/0`) - Options to configure the HTTP/2 stack in Bandit. The default value is `[]`.
* `:thousand_island_options` (`t:keyword/0`) - Possible options to configure a ThousandIsland server. The default value is `[]`.
* `:websocket_options` (`t:keyword/0`) - Options to configure the WebSocket stack in Bandit. The default value is `[]`.
* `:certfile` (`t:String.t/0`) - The path to a file containing the SSL certificate to use for this listener.
* `:keyfile` (`t:String.t/0`) - The path to a file containing the SSL key to use for this listener.
* `:cipher_suite` - Used to define a pre-selected set of ciphers, as described by `Plug.SSL.configure/1`. Valid values are nil, :strong, :compatible
##### targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
* `:algorithm` - The target selection algorithm. Valid values are :round_robin, :sticky The default value is `:round_robin`.
###### http
* health_checks
* check
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the target (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
####### health_checks
* check
######## check
* `:name` - A unique name for the health check.
* `:method` - The HTTP method to use for the request. Valid values are :get, :head, :post, :put, :delete, :connect, :options, :trace, :patch The default value is `:get`.
* `:connect_timeout` (`t:pos_integer/0`) - Connection timeout in milliseconds The default value is `5000`.
* `:response_timeout` (`t:pos_integer/0`) - Response timeout in milliseconds The default value is `500`.
* `:hostname` - The HTTP hostname to use when sending the request. Defaults to the IP address.
* `:interval` (`t:pos_integer/0`) - Interval in milliseconds The default value is `30000`.
* `:threshold` (`t:pos_integer/0`) - Success threshold The default value is `3`.
* `:path` (`t:String.t/0`) - Path The default value is `"/"`.
* `:success_codes` (one or a list of struct of type `Range`) - HTTP status codes which are considered successful. The default value is `[200..299]`.
###### https
* health_checks
* check
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the target (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
####### health_checks
* check
######## check
* `:name` - A unique name for the health check.
* `:method` - The HTTP method to use for the request. Valid values are :get, :head, :post, :put, :delete, :connect, :options, :trace, :patch The default value is `:get`.
* `:connect_timeout` (`t:pos_integer/0`) - Connection timeout in milliseconds The default value is `5000`.
* `:response_timeout` (`t:pos_integer/0`) - Response timeout in milliseconds The default value is `500`.
* `:hostname` - The HTTP hostname to use when sending the request. Defaults to the IP address.
* `:interval` (`t:pos_integer/0`) - Interval in milliseconds The default value is `30000`.
* `:threshold` (`t:pos_integer/0`) - Success threshold The default value is `3`.
* `:path` (`t:String.t/0`) - Path The default value is `"/"`.
* `:success_codes` (one or a list of struct of type `Range`) - HTTP status codes which are considered successful. The default value is `[200..299]`.
###### plug
* `:module` (module that adopts `Plug` or a module and options) - Required. A plug which can handle requests.
## wayfarer
### Nested DSLs
* [config](#wayfarer-config)
* health_checks
* check
* host_patterns
* pattern
* listeners
* http
* https
* targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
## wayfarer.config
```elixir
config name \\ nil
```
### Nested DSLs
* [health_checks](#wayfarer-config-health_checks)
* check
* [host_patterns](#wayfarer-config-host_patterns)
* pattern
* [listeners](#wayfarer-config-listeners)
* http
* https
* [targets](#wayfarer-config-targets)
* http
* health_checks
* check
* https
* health_checks
* check
* plug
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#wayfarer-config-name){: #wayfarer-config-name } | `String.t` | | |
## wayfarer.config.health_checks
### Nested DSLs
* [check](#wayfarer-config-health_checks-check)
## wayfarer.config.health_checks.check
```elixir
check name \\ nil
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#wayfarer-config-health_checks-check-name){: #wayfarer-config-health_checks-check-name } | `String.t \| nil` | | A unique name for the health check. |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`method`](#wayfarer-config-health_checks-check-method){: #wayfarer-config-health_checks-check-method } | `:get \| :head \| :post \| :put \| :delete \| :connect \| :options \| :trace \| :patch` | `:get` | The HTTP method to use for the request. |
| [`connect_timeout`](#wayfarer-config-health_checks-check-connect_timeout){: #wayfarer-config-health_checks-check-connect_timeout } | `pos_integer` | `5000` | Connection timeout in milliseconds |
| [`response_timeout`](#wayfarer-config-health_checks-check-response_timeout){: #wayfarer-config-health_checks-check-response_timeout } | `pos_integer` | `500` | Response timeout in milliseconds |
| [`hostname`](#wayfarer-config-health_checks-check-hostname){: #wayfarer-config-health_checks-check-hostname } | `nil \| String.t` | | The HTTP hostname to use when sending the request. Defaults to the IP address. |
| [`interval`](#wayfarer-config-health_checks-check-interval){: #wayfarer-config-health_checks-check-interval } | `pos_integer` | `30000` | Interval in milliseconds |
| [`threshold`](#wayfarer-config-health_checks-check-threshold){: #wayfarer-config-health_checks-check-threshold } | `pos_integer` | `3` | Success threshold |
| [`path`](#wayfarer-config-health_checks-check-path){: #wayfarer-config-health_checks-check-path } | `String.t` | `"/"` | Path |
| [`success_codes`](#wayfarer-config-health_checks-check-success_codes){: #wayfarer-config-health_checks-check-success_codes } | `Range \| list(Range)` | `[200..299]` | HTTP status codes which are considered successful. |
### Introspection
Target: `Wayfarer.Dsl.HealthCheck`
### Introspection
Target: `Wayfarer.Dsl.HealthChecks`
## wayfarer.config.host_patterns
### Nested DSLs
* [pattern](#wayfarer-config-host_patterns-pattern)
## wayfarer.config.host_patterns.pattern
```elixir
pattern pattern
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`pattern`](#wayfarer-config-host_patterns-pattern-pattern){: #wayfarer-config-host_patterns-pattern-pattern .spark-required} | `String.t` | | A hostname matching pattern. |
### Introspection
Target: `Wayfarer.Dsl.HostPattern`
### Introspection
Target: `Wayfarer.Dsl.HostPatterns`
## wayfarer.config.listeners
### Nested DSLs
* [http](#wayfarer-config-listeners-http)
* [https](#wayfarer-config-listeners-https)
## wayfarer.config.listeners.http
```elixir
http address, port
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`address`](#wayfarer-config-listeners-http-address){: #wayfarer-config-listeners-http-address .spark-required} | `IP.Address \| String.t` | | The address of the interface to listen on. |
| [`port`](#wayfarer-config-listeners-http-port){: #wayfarer-config-listeners-http-port .spark-required} | `pos_integer` | | The TCP port on which to listen for incoming connections. |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`scheme`](#wayfarer-config-listeners-http-scheme){: #wayfarer-config-listeners-http-scheme .spark-required} | `:http \| :https` | | The listening protocol. |
| [`name`](#wayfarer-config-listeners-http-name){: #wayfarer-config-listeners-http-name } | `nil \| String.t` | | A unique name for the listener (defaults to the URI). |
| [`http_1_options`](#wayfarer-config-listeners-http-http_1_options){: #wayfarer-config-listeners-http-http_1_options } | `keyword` | `[]` | Options to configure the HTTP/1 stack in Bandit. |
| [`http_2_options`](#wayfarer-config-listeners-http-http_2_options){: #wayfarer-config-listeners-http-http_2_options } | `keyword` | `[]` | Options to configure the HTTP/2 stack in Bandit. |
| [`thousand_island_options`](#wayfarer-config-listeners-http-thousand_island_options){: #wayfarer-config-listeners-http-thousand_island_options } | `keyword` | `[]` | Possible options to configure a ThousandIsland server. |
| [`websocket_options`](#wayfarer-config-listeners-http-websocket_options){: #wayfarer-config-listeners-http-websocket_options } | `keyword` | `[]` | Options to configure the WebSocket stack in Bandit. |
### Introspection
Target: `Wayfarer.Dsl.Listener`
## wayfarer.config.listeners.https
```elixir
https address, port
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`address`](#wayfarer-config-listeners-https-address){: #wayfarer-config-listeners-https-address .spark-required} | `IP.Address \| String.t` | | The address of the interface to listen on. |
| [`port`](#wayfarer-config-listeners-https-port){: #wayfarer-config-listeners-https-port .spark-required} | `pos_integer` | | The TCP port on which to listen for incoming connections. |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`scheme`](#wayfarer-config-listeners-https-scheme){: #wayfarer-config-listeners-https-scheme .spark-required} | `:http \| :https` | | The listening protocol. |
| [`name`](#wayfarer-config-listeners-https-name){: #wayfarer-config-listeners-https-name } | `nil \| String.t` | | A unique name for the listener (defaults to the URI). |
| [`http_1_options`](#wayfarer-config-listeners-https-http_1_options){: #wayfarer-config-listeners-https-http_1_options } | `keyword` | `[]` | Options to configure the HTTP/1 stack in Bandit. |
| [`http_2_options`](#wayfarer-config-listeners-https-http_2_options){: #wayfarer-config-listeners-https-http_2_options } | `keyword` | `[]` | Options to configure the HTTP/2 stack in Bandit. |
| [`thousand_island_options`](#wayfarer-config-listeners-https-thousand_island_options){: #wayfarer-config-listeners-https-thousand_island_options } | `keyword` | `[]` | Possible options to configure a ThousandIsland server. |
| [`websocket_options`](#wayfarer-config-listeners-https-websocket_options){: #wayfarer-config-listeners-https-websocket_options } | `keyword` | `[]` | Options to configure the WebSocket stack in Bandit. |
| [`certfile`](#wayfarer-config-listeners-https-certfile){: #wayfarer-config-listeners-https-certfile } | `String.t` | | The path to a file containing the SSL certificate to use for this listener. |
| [`keyfile`](#wayfarer-config-listeners-https-keyfile){: #wayfarer-config-listeners-https-keyfile } | `String.t` | | The path to a file containing the SSL key to use for this listener. |
| [`cipher_suite`](#wayfarer-config-listeners-https-cipher_suite){: #wayfarer-config-listeners-https-cipher_suite } | `nil \| :strong \| :compatible` | | Used to define a pre-selected set of ciphers, as described by `Plug.SSL.configure/1`. |
### Introspection
Target: `Wayfarer.Dsl.Listener`
### Introspection
Target: `Wayfarer.Dsl.Listeners`
## wayfarer.config.targets
### Nested DSLs
* [http](#wayfarer-config-targets-http)
* health_checks
* check
* [https](#wayfarer-config-targets-https)
* health_checks
* check
* [plug](#wayfarer-config-targets-plug)
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`algorithm`](#wayfarer-config-targets-algorithm){: #wayfarer-config-targets-algorithm } | `:round_robin \| :sticky` | `:round_robin` | The target selection algorithm. |
## wayfarer.config.targets.http
```elixir
http address, port
```
### Nested DSLs
* [health_checks](#wayfarer-config-targets-http-health_checks)
* check
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`address`](#wayfarer-config-targets-http-address){: #wayfarer-config-targets-http-address .spark-required} | `IP.Address \| String.t` | | The address of the interface to listen on. |
| [`port`](#wayfarer-config-targets-http-port){: #wayfarer-config-targets-http-port .spark-required} | `pos_integer` | | The TCP port on which to listen for incoming connections. |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#wayfarer-config-targets-http-name){: #wayfarer-config-targets-http-name } | `nil \| String.t` | | A unique name for the target (defaults to the URI). |
## wayfarer.config.targets.http.health_checks
### Nested DSLs
* [check](#wayfarer-config-targets-http-health_checks-check)
## wayfarer.config.targets.http.health_checks.check
```elixir
check name \\ nil
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#wayfarer-config-targets-http-health_checks-check-name){: #wayfarer-config-targets-http-health_checks-check-name } | `String.t \| nil` | | A unique name for the health check. |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`method`](#wayfarer-config-targets-http-health_checks-check-method){: #wayfarer-config-targets-http-health_checks-check-method } | `:get \| :head \| :post \| :put \| :delete \| :connect \| :options \| :trace \| :patch` | `:get` | The HTTP method to use for the request. |
| [`connect_timeout`](#wayfarer-config-targets-http-health_checks-check-connect_timeout){: #wayfarer-config-targets-http-health_checks-check-connect_timeout } | `pos_integer` | `5000` | Connection timeout in milliseconds |
| [`response_timeout`](#wayfarer-config-targets-http-health_checks-check-response_timeout){: #wayfarer-config-targets-http-health_checks-check-response_timeout } | `pos_integer` | `500` | Response timeout in milliseconds |
| [`hostname`](#wayfarer-config-targets-http-health_checks-check-hostname){: #wayfarer-config-targets-http-health_checks-check-hostname } | `nil \| String.t` | | The HTTP hostname to use when sending the request. Defaults to the IP address. |
| [`interval`](#wayfarer-config-targets-http-health_checks-check-interval){: #wayfarer-config-targets-http-health_checks-check-interval } | `pos_integer` | `30000` | Interval in milliseconds |
| [`threshold`](#wayfarer-config-targets-http-health_checks-check-threshold){: #wayfarer-config-targets-http-health_checks-check-threshold } | `pos_integer` | `3` | Success threshold |
| [`path`](#wayfarer-config-targets-http-health_checks-check-path){: #wayfarer-config-targets-http-health_checks-check-path } | `String.t` | `"/"` | Path |
| [`success_codes`](#wayfarer-config-targets-http-health_checks-check-success_codes){: #wayfarer-config-targets-http-health_checks-check-success_codes } | `Range \| list(Range)` | `[200..299]` | HTTP status codes which are considered successful. |
### Introspection
Target: `Wayfarer.Dsl.HealthCheck`
### Introspection
Target: `Wayfarer.Dsl.HealthChecks`
### Introspection
Target: `Wayfarer.Dsl.Target`
## wayfarer.config.targets.https
```elixir
https address, port
```
### Nested DSLs
* [health_checks](#wayfarer-config-targets-https-health_checks)
* check
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`address`](#wayfarer-config-targets-https-address){: #wayfarer-config-targets-https-address .spark-required} | `IP.Address \| String.t` | | The address of the interface to listen on. |
| [`port`](#wayfarer-config-targets-https-port){: #wayfarer-config-targets-https-port .spark-required} | `pos_integer` | | The TCP port on which to listen for incoming connections. |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#wayfarer-config-targets-https-name){: #wayfarer-config-targets-https-name } | `nil \| String.t` | | A unique name for the target (defaults to the URI). |
## wayfarer.config.targets.https.health_checks
### Nested DSLs
* [check](#wayfarer-config-targets-https-health_checks-check)
## wayfarer.config.targets.https.health_checks.check
```elixir
check name \\ nil
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#wayfarer-config-targets-https-health_checks-check-name){: #wayfarer-config-targets-https-health_checks-check-name } | `String.t \| nil` | | A unique name for the health check. |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`method`](#wayfarer-config-targets-https-health_checks-check-method){: #wayfarer-config-targets-https-health_checks-check-method } | `:get \| :head \| :post \| :put \| :delete \| :connect \| :options \| :trace \| :patch` | `:get` | The HTTP method to use for the request. |
| [`connect_timeout`](#wayfarer-config-targets-https-health_checks-check-connect_timeout){: #wayfarer-config-targets-https-health_checks-check-connect_timeout } | `pos_integer` | `5000` | Connection timeout in milliseconds |
| [`response_timeout`](#wayfarer-config-targets-https-health_checks-check-response_timeout){: #wayfarer-config-targets-https-health_checks-check-response_timeout } | `pos_integer` | `500` | Response timeout in milliseconds |
| [`hostname`](#wayfarer-config-targets-https-health_checks-check-hostname){: #wayfarer-config-targets-https-health_checks-check-hostname } | `nil \| String.t` | | The HTTP hostname to use when sending the request. Defaults to the IP address. |
| [`interval`](#wayfarer-config-targets-https-health_checks-check-interval){: #wayfarer-config-targets-https-health_checks-check-interval } | `pos_integer` | `30000` | Interval in milliseconds |
| [`threshold`](#wayfarer-config-targets-https-health_checks-check-threshold){: #wayfarer-config-targets-https-health_checks-check-threshold } | `pos_integer` | `3` | Success threshold |
| [`path`](#wayfarer-config-targets-https-health_checks-check-path){: #wayfarer-config-targets-https-health_checks-check-path } | `String.t` | `"/"` | Path |
| [`success_codes`](#wayfarer-config-targets-https-health_checks-check-success_codes){: #wayfarer-config-targets-https-health_checks-check-success_codes } | `Range \| list(Range)` | `[200..299]` | HTTP status codes which are considered successful. |
### Introspection
Target: `Wayfarer.Dsl.HealthCheck`
### Introspection
Target: `Wayfarer.Dsl.HealthChecks`
### Introspection
Target: `Wayfarer.Dsl.Target`
## wayfarer.config.targets.plug
```elixir
plug module
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`module`](#wayfarer-config-targets-plug-module){: #wayfarer-config-targets-plug-module .spark-required} | `module` | | A plug which can handle requests. |
### Introspection
Target: `Wayfarer.Dsl.Target`
### Introspection
Target: `Wayfarer.Dsl.Targets`
### Introspection
Target: `Wayfarer.Dsl.Config`
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>