https://github.com/golossus/routing
A routing component for HTTP handing in Go
https://github.com/golossus/routing
go golang http mux router
Last synced: about 2 months ago
JSON representation
A routing component for HTTP handing in Go
- Host: GitHub
- URL: https://github.com/golossus/routing
- Owner: golossus
- License: mit
- Created: 2019-11-25T16:21:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-14T20:34:11.000Z (over 4 years ago)
- Last Synced: 2023-07-27T22:09:32.919Z (over 2 years ago)
- Topics: go, golang, http, mux, router
- Language: Go
- Homepage: https://www.golossus.com
- Size: 181 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

[](https://codecov.io/gh/golossus/routing)
[](https://goreportcard.com/report/github.com/golossus/routing)
[](https://www.codefactor.io/repository/github/golossus/routing)
[](https://sonarcloud.io/dashboard?id=golossus_routing)
[Golossus][1] is a set of reusable **Go modules** to facilitate the creation of
web applications leveraging Go's standard packages, mainly **net/http**.
The routing module exposes a **Router** or commonly known as **Mux** to map urls to
specific handlers. It provides an enhanced set of features to improve default mux
capabilities:
* Binary tree search for static routes.
* Allows dynamic routes with parameters.
* Parameter constraints matching.
* Http verbs matching.
* Semantic interface.
* More to come...
Installation
------------
The routing package is just a common Go module. You can install it as any other Go module.
To get more information just review the official [Go blog][2] regarding this topic.
Usage
-----
This is just a quick introduction, view the [GoDoc][3] for details.
Basic usage example:
```go
package main
import (
"fmt"
"net/http"
"log"
"github.com/golossus/routing"
)
func Index(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Welcome!\n")
}
func Hello(w http.ResponseWriter, r *http.Request) {
ps := routing.GetURLParameters(r)
fmt.Fprintf(w, "hello, %s!\n", ps.GetByName("name"))
}
func main() {
router := routing.NewRouter()
router.Get("/", Index)
router.Get("/hello/{name}", Hello)
log.Fatal(http.ListenAndServe(":8080", router))
}
```
Documentation
-------------
[Official website][1] is still under construction and documentation is not yet finished. Stay
tunned to discover things to come, or [subscribe to our newsletter][4] to get direct notifications.
Community
---------
* Join our [Slack][5] to meet the community and get support.
* Follow us on [GitHub][6].
* Read our [Code of Conduct][7].
Contributing
------------
Golossus is an Open Source project. The Golossus team wants to enable it to be community-driven
and open to [contributors][8]. Take a look at [contributing documentation][9].
Security Issues
---------------
If you discover a security vulnerability within Golossus, please follow our
[disclosure procedure][10].
About Us
--------
Golossus development is led by the Golossus Team [Leaders][12] and supported by [contributors][8].
It started and supported as a **hackweek** project at [New Work SE][13], we can just say thank you!
[1]: https://www.golossus.com
[2]: https://blog.golang.org/using-go-modules
[3]: http://godoc.org/github.com/golossus/routing
[4]: mailto:subscribe@golossus.com
[5]: https://join.slack.com/t/golossus/shared_invite/zt-db4brnes-M8q1Lw2ouFT5X~gQg69NQQ
[6]: https://github.com/golossus
[7]: ./CODE_OF_CONDUCT.md
[8]: ./CONTRIBUTORS.md
[9]: ./CONTRIBUTING.md
[10]: ./CONTRIBUTING.md#reporting-a-security-issue
[12]: ./CONTRIBUTING.md#leaders
[13]: https://www.new-work.se/en/