aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go.mod2
-rw-r--r--go.sum10
-rw-r--r--server.go7
3 files changed, 5 insertions, 14 deletions
diff --git a/go.mod b/go.mod
index 6b30a7a..6605b49 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.14
require (
git.sr.ht/~shulhan/asciidoctor-go v0.0.0-20201226102329-36285ff15434
- github.com/shuLhan/share v0.23.1-0.20210220203139-c1ad6a68b1fe
+ github.com/shuLhan/share v0.23.1-0.20210303203144-6442d1f4055a
)
//replace git.sr.ht/~shulhan/asciidoctor-go => ../asciidoctor-go
diff --git a/go.sum b/go.sum
index 72dda4f..af4b685 100644
--- a/go.sum
+++ b/go.sum
@@ -1,20 +1,14 @@
-git.sr.ht/~shulhan/asciidoctor-go v0.0.0-20201205130914-be765f32b57b/go.mod h1:ejaxKeBMNL5EpP2zjRP4B8zuOr+MM4ZyGwE3y7807WI=
git.sr.ht/~shulhan/asciidoctor-go v0.0.0-20201226102329-36285ff15434 h1:1iZnuHKdzhHgZePCmk47xTWoZCmqQG0Vpo/Nwk6SeYo=
git.sr.ht/~shulhan/asciidoctor-go v0.0.0-20201226102329-36285ff15434/go.mod h1:ejaxKeBMNL5EpP2zjRP4B8zuOr+MM4ZyGwE3y7807WI=
-git.sr.ht/~shulhan/ciigo v0.3.0/go.mod h1:Y5FvSiJg88qshoR1ktj4fLzM5sk1pZcV0kJGU8GAuTo=
-git.sr.ht/~shulhan/ciigo v0.3.1-0.20210109200358-c23bd42ef521/go.mod h1:DLyaapVphRtqry80iqw+luWAKepHtbDmbvxqFmulcko=
github.com/shuLhan/share v0.20.2-0.20201122173411-e8b3bf5ee6e9/go.mod h1:oBv+CGHG6u4Sa71+nJJJji8mCgPAadywjsB3I3k/b0o=
-github.com/shuLhan/share v0.20.2-0.20201205202022-66069b9e49fe/go.mod h1:oBv+CGHG6u4Sa71+nJJJji8mCgPAadywjsB3I3k/b0o=
-github.com/shuLhan/share v0.22.1-0.20210109185915-0490a19341d9/go.mod h1:u9caerexlcxmPVDttj7PnkxCBDY6yBRTZ+gGR+1tO98=
-github.com/shuLhan/share v0.23.1-0.20210220203139-c1ad6a68b1fe h1:quKB8ABlVHnqwmp2QwUi9NrN8eTgtFgrfATNFvfRw8k=
-github.com/shuLhan/share v0.23.1-0.20210220203139-c1ad6a68b1fe/go.mod h1:y4+p5vUmKNNhMMhU6yGgE6QxTgJxA4nv6OOq+cIf7wU=
+github.com/shuLhan/share v0.23.1-0.20210303203144-6442d1f4055a h1:ZgIYnibYPhU+yigJ0/HB1ILHP9HOCDsYqoLlpVBZpVs=
+github.com/shuLhan/share v0.23.1-0.20210303203144-6442d1f4055a/go.mod h1:c6xnA1EctNz2KGVlekfydyXoUjpTPjyUHUIyWSELN/c=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
diff --git a/server.go b/server.go
index 3855eed..e787b30 100644
--- a/server.go
+++ b/server.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"html/template"
- "net/http"
"strings"
"github.com/shuLhan/share/lib/debug"
@@ -112,13 +111,11 @@ func (srv *server) start() (err error) {
return nil
}
-func (srv *server) onSearch(res http.ResponseWriter, req *http.Request, reqBody []byte) (
- resBody []byte, err error,
-) {
+func (srv *server) onSearch(epr *libhttp.EndpointRequest) (resBody []byte, err error) {
var bufSearch, buf bytes.Buffer
logp := "onSearch"
- q := req.Form.Get("q")
+ q := epr.HttpRequest.Form.Get("q")
results := srv.http.Memfs.Search(strings.Fields(q), 0)
err = srv.htmlg.tmplSearch.Execute(&bufSearch, results)