aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-07-25 02:30:37 +0700
committerShulhan <ms@kilabit.info>2025-07-29 00:31:23 +0700
commit0537c5e094c7b6e5ff376ccdf0dba80adf5c4342 (patch)
treeb8c2c3621c1e76c5182acdc2f09291b796792a9e /testdata
parent3d4c7b48674cd553ce8f670933af9b609992ae77 (diff)
downloadlilin-0537c5e094c7b6e5ff376ccdf0dba80adf5c4342.tar.xz
all: refactoring Service to create with ServiceOptions
Instead of defining the options in the Service, create it in the ServiceOptions and pass it to NewService function. In this way, we can check it, initialize it, and set default value. The Address option now use URL with scheme, so we can derive the service type based on the scheme, for example "http://" for HTTP based service, "tcp://xxx" for TCP based service, and so on.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/etc/lilin/service.d/http.cfg1
-rw-r--r--testdata/etc/lilin/service.d/tcp.cfg3
-rw-r--r--testdata/etc/lilin/service.d/udp.cfg3
3 files changed, 2 insertions, 5 deletions
diff --git a/testdata/etc/lilin/service.d/http.cfg b/testdata/etc/lilin/service.d/http.cfg
index 70e6d58..95a3554 100644
--- a/testdata/etc/lilin/service.d/http.cfg
+++ b/testdata/etc/lilin/service.d/http.cfg
@@ -1,5 +1,4 @@
[service "example http"]
-type = http
method = GET
address = http://127.0.0.1:6121/health
timeout = 5s
diff --git a/testdata/etc/lilin/service.d/tcp.cfg b/testdata/etc/lilin/service.d/tcp.cfg
index dce3c7d..0bf8cb5 100644
--- a/testdata/etc/lilin/service.d/tcp.cfg
+++ b/testdata/etc/lilin/service.d/tcp.cfg
@@ -1,4 +1,3 @@
[service "example tcp"]
-type = tcp
-address = 127.0.0.1:6122
+address = tcp://127.0.0.1:6122
timeout = 5s
diff --git a/testdata/etc/lilin/service.d/udp.cfg b/testdata/etc/lilin/service.d/udp.cfg
index b553c17..ac650b0 100644
--- a/testdata/etc/lilin/service.d/udp.cfg
+++ b/testdata/etc/lilin/service.d/udp.cfg
@@ -1,4 +1,3 @@
[service "example udp"]
-type = udp
-address = 127.0.0.1:6123
+address = udp://127.0.0.1:6123
timeout = 5s