diff options
| author | Shulhan <ms@kilabit.info> | 2026-02-12 00:17:29 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-02-12 01:29:15 +0700 |
| commit | ff5a7ecdb8aa0ccfe4bd4f71648e7254e470c930 (patch) | |
| tree | 20f64fff336b5881b3db03db2052b209fefd23c3 /awwan.go | |
| parent | 2686a70d0eeb14c0eba68f449658827e144e75a2 (diff) | |
| download | awwan-ff5a7ecdb8aa0ccfe4bd4f71648e7254e470c930.tar.xz | |
all: change Serve parameters to struct `ServeOptions`
In case we needs to add another parameter, which will do later, the
argument will be too long.
Using parameters is acceptable only for 2 to 3 arguments.
Diffstat (limited to 'awwan.go')
| -rw-r--r-- | awwan.go | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -7,7 +7,6 @@ import ( "context" "fmt" "log" - "net" "os" "path/filepath" "strconv" @@ -21,7 +20,7 @@ import ( ) // Version current version of this module (library and program). -var Version = `0.13.2` +var Version = `0.14.0` // osGetwd define the handler to get current working directory. // @@ -485,14 +484,14 @@ out: } // Serve start the web-user interface that serve awwan through HTTP. -func (aww *Awwan) Serve(listener net.Listener, address string, isDev bool) (err error) { +func (aww *Awwan) Serve(serveOpts ServeOptions) (err error) { var logp = `Serve` - if isDev { + if serveOpts.IsDevelopment { go internal.Watch() } - aww.httpd, err = newHTTPServer(aww, listener, address) + aww.httpd, err = newHTTPServer(aww, serveOpts) if err != nil { return fmt.Errorf(`%s: %w`, logp, err) } |
