diff options
| author | Shulhan <ms@kilabit.info> | 2026-02-07 16:03:19 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-02-07 16:03:19 +0700 |
| commit | 3714f15bf29cfb79c3623784e391a7a4854f6815 (patch) | |
| tree | 09913bd02652a11dd1b894c0e2093f78f522548c /internal/cmd/ciigo-example/main.go | |
| parent | 759c9b8e542d2ce159228e35c6d4138fbaef25de (diff) | |
| download | ciigo-3714f15bf29cfb79c3623784e391a7a4854f6815.tar.xz | |
all: embed struct [lib/http.ServerOptions] directly to [ServeOptions]
At this point, all of the fields in the struct ServeOptions is the
same with [lib/http.ServerOptions] except IsDevelopment and
ConvertOptions.
For field IsDevelopment we keep in the struct.
For field ConvertOptions we remove it and let the caller pass it on
Serve function or InitHTTPServer method.
Diffstat (limited to 'internal/cmd/ciigo-example/main.go')
| -rw-r--r-- | internal/cmd/ciigo-example/main.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/internal/cmd/ciigo-example/main.go b/internal/cmd/ciigo-example/main.go index e1b8c58..7cd8ef9 100644 --- a/internal/cmd/ciigo-example/main.go +++ b/internal/cmd/ciigo-example/main.go @@ -10,6 +10,7 @@ import ( "log" "strings" + libhttp "git.sr.ht/~shulhan/pakakeh.go/lib/http" "git.sr.ht/~shulhan/pakakeh.go/lib/memfs" "git.sr.ht/~shulhan/ciigo" @@ -23,13 +24,15 @@ var ciigoFS *memfs.MemFS func main() { var ( - opts = ciigo.ServeOptions{ - ConvertOptions: ciigo.ConvertOptions{ - Root: `_example`, - HTMLTemplate: `_example/html.tmpl`, + convertOpts = ciigo.ConvertOptions{ + Root: `_example`, + HTMLTemplate: `_example/html.tmpl`, + } + serveOpts = ciigo.ServeOptions{ + ServerOptions: libhttp.ServerOptions{ + Memfs: ciigoFS, + Address: `127.0.0.1:8080`, }, - Mfs: ciigoFS, - Address: `127.0.0.1:8080`, IsDevelopment: true, } @@ -45,7 +48,7 @@ func main() { return } - err = ciigo.Serve(opts) + err = ciigo.Serve(serveOpts, convertOpts) if err != nil { log.Fatal(err) } |
