aboutsummaryrefslogtreecommitdiff
path: root/awwan.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-02-12 00:17:29 +0700
committerShulhan <ms@kilabit.info>2026-02-12 01:29:15 +0700
commitff5a7ecdb8aa0ccfe4bd4f71648e7254e470c930 (patch)
tree20f64fff336b5881b3db03db2052b209fefd23c3 /awwan.go
parent2686a70d0eeb14c0eba68f449658827e144e75a2 (diff)
downloadawwan-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.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/awwan.go b/awwan.go
index 4a34fe0..32da73f 100644
--- a/awwan.go
+++ b/awwan.go
@@ -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)
}