1
0
Fork 0

feat: use parser to load dynamic config from file.

This commit is contained in:
Ludovic Fernandez 2020-06-17 16:48:04 +02:00 committed by GitHub
parent 7affeae480
commit cb1d0441e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 187 additions and 88 deletions

View file

@ -1,5 +1,5 @@
[http.routers]
[http.routers."router1"]
service = "application-1"

View file

@ -66,7 +66,7 @@
[tcp.services.applicationtcp-1.loadBalancer]
[[tcp.services.applicationtcp-1.loadBalancer.servers]]
url = "http://172.17.0.9:80"
address = "http://172.17.0.9:80"
[udp.routers]
@ -77,4 +77,4 @@
[udp.services.applicationudp-1.loadBalancer]
[[udp.services.applicationudp-1.loadBalancer.servers]]
url = "http://172.17.0.10:80"
address = "http://172.17.0.10:80"

View file

@ -1,6 +1,6 @@
[http.services]
{{ range $i, $e := until 20 }}
[http.services.application-{{ $e }}]
[[http.services.application-{{ $e }}.servers]]
url="http://127.0.0.1"
[http.services.application-{{ $e }}.loadBalancer]
[[http.services.application-{{ $e }}.loadBalancer.servers]]
url = "http://127.0.0.1"
{{ end }}

View file

@ -1,6 +1,6 @@
http:
{{ range $i, $e := until 20 }}
routers:
{{ range $i, $e := until 20 }}
router{{ $e }}:
service: application-1
{{ end }}