aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-07-21 00:22:50 +0700
committerShulhan <ms@kilabit.info>2025-07-23 09:32:16 +0700
commit3d4c7b48674cd553ce8f670933af9b609992ae77 (patch)
treeae35fc18ed901bcb3d13aa3a0e4abf45287f2579 /server.go
parent4d4b26dff03083955871439ee6e0ef9bd07c5a1c (diff)
downloadlilin-3d4c7b48674cd553ce8f670933af9b609992ae77.tar.xz
wip: implement loading per service configuration
The service configuration is stored under "$BASE_DIR/etc/lilin/service.d". with ".cfg" as the file extension. The service configuration use INI format.
Diffstat (limited to 'server.go')
-rw-r--r--server.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/server.go b/server.go
index 2675521..bd272ec 100644
--- a/server.go
+++ b/server.go
@@ -32,7 +32,6 @@ func NewServer(opts ServerOptions) (srv *Server, err error) {
srv = &Server{
Options: opts,
- worker: newWorker(),
}
err = srv.Options.init()
@@ -40,6 +39,11 @@ func NewServer(opts ServerOptions) (srv *Server, err error) {
return nil, fmt.Errorf(`%s: %w`, logp, err)
}
+ srv.worker, err = newWorker(srv.Options.configDir)
+ if err != nil {
+ return nil, fmt.Errorf(`%s: %w`, logp, err)
+ }
+
var mux = http.NewServeMux()
mux.HandleFunc(`GET `+pathAPIServicesSummary, srv.handleServicesSummary)