diff mbox series

[bug#54560,12/47] gnu: Add go-github-com-julienschmidt-httprouter.

Message ID 20220325133211.5128-12-hello@lnikki.la
State New
Headers show
Series [bug#54560,01/47] gnu: Add go-google-golang-org-protobuf. | expand

Commit Message

Leo Nikkilä March 25, 2022, 1:31 p.m. UTC
* gnu/packages/golang.scm (go-github-com-julienschmidt-httprouter): New
variable.
---
 gnu/packages/golang.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

M March 25, 2022, 7:47 p.m. UTC | #1
Leo Nikkilä schreef op vr 25-03-2022 om 15:31 [+0200]:
> +    (synopsis "High performance HTTP request router")
> +    (description
> +     "HttpRouter is a lightweight high performance [...]
> +
> +In contrast to the default mux of Go's @code{net/http} package, this
> +router [...].  It also scales better.
> +
> +The router is optimized for high performance and a small memory
> +footprint.  It scales well even with very long paths and a large number
> +of routes.
> 

While it seems that HttpRouter actually has some evidence for these
claims about lightweightness and performance
(https://github.com/julienschmidt/go-http-routing-benchmark),
it still leans rather close to marketing, and AFAIK the conclusions
have not been independently verified.

>   A compressing dynamic trie (radix tree) structure is used for

This is an implementation detail and hence doesn't seem relevant to me.

Greetings,
Maxime
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a9286f8b8a..cf4c85b7cc 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9967,6 +9967,38 @@  (define-public go-github-com-josharian-intern
     (home-page "https://github.com/josharian/intern")
     (license license:expat)))
 
+(define-public go-github-com-julienschmidt-httprouter
+  (package
+    (name "go-github-com-julienschmidt-httprouter")
+    (version "1.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/julienschmidt/httprouter")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1a6sy0ysqknsjssjh7qg1dqn21xmj9a36c57nrk7srfmab4ffmk1"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/julienschmidt/httprouter"))
+    (synopsis "High performance HTTP request router")
+    (description
+     "HttpRouter is a lightweight high performance HTTP request router
+(also called multiplexer or just mux for short) for Go.
+
+In contrast to the default mux of Go's @code{net/http} package, this
+router supports variables in the routing pattern and matches against the
+request method.  It also scales better.
+
+The router is optimized for high performance and a small memory
+footprint.  It scales well even with very long paths and a large number
+of routes.  A compressing dynamic trie (radix tree) structure is used for
+efficient matching.")
+    (home-page "https://github.com/julienschmidt/httprouter")
+    (license license:bsd-3)))
+
 (define-public go-google-golang-org-protobuf
   (package
     (name "go-google-golang-org-protobuf")