diff options
| author | Shulhan <ms@kilabit.info> | 2025-07-21 00:22:50 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-07-23 09:32:16 +0700 |
| commit | 3d4c7b48674cd553ce8f670933af9b609992ae77 (patch) | |
| tree | ae35fc18ed901bcb3d13aa3a0e4abf45287f2579 /server_options.go | |
| parent | 4d4b26dff03083955871439ee6e0ef9bd07c5a1c (diff) | |
| download | lilin-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_options.go')
| -rw-r--r-- | server_options.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server_options.go b/server_options.go index 681ad14..5197ffd 100644 --- a/server_options.go +++ b/server_options.go @@ -19,6 +19,9 @@ type ServerOptions struct { // logs. BaseDir string + // The BaseDir + "/etc/lilin/". + configDir string + // The address to listen for HTTP server and APIs. Address string `ini:"server::address"` } @@ -32,7 +35,9 @@ func (opts *ServerOptions) init() (err error) { opts.BaseDir = `/` } - var cfg = filepath.Join(opts.BaseDir, `etc`, `lilin`, `lilin.cfg`) + opts.configDir = filepath.Join(opts.BaseDir, `etc`, `lilin`) + + var cfg = filepath.Join(opts.configDir, `lilin.cfg`) _, err = os.Stat(cfg) if err != nil { return nil |
