httprouter
logrus
httprouter | logrus | |
---|---|---|
38 | 32 | |
16,352 | 24,149 | |
- | - | |
5.3 | 1.6 | |
about 2 months ago | 15 days ago | |
Go | Go | |
BSD 3-clause "New" or "Revised" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
httprouter
-
From Homemade HTTP Router to New ServeMux
Even third-party HTTP routers take conflict detection into consideration; for example, httprouter either matches one pattern or it doesn't. It is designed to become.
-
Authentication system using Golang and Sveltekit - Initialization and setup
Following the completion of the series — Secure and performant full-stack authentication system using rust (actix-web) and sveltekit and Secure and performant full-stack authentication system using Python (Django) and SvelteKit — I felt I should keep the streak by building an equivalent system in PURE go with very minimal external dependencies. We won't use any fancy web framework apart from httprouter and other basic dependencies including a database driver (pq), and redis client. As usual, we'll be using SvelteKit at the front end, favouring JSDoc instead of TypeScript. The combination is ecstatic!
-
Gin - HTTP web framework written in GO.
Gin is a web framework written in Go. It features a martini-like API with performance that is up to 40 times faster thanks to httprouter. If you need performance and good productivity, you will love Gin.
-
what's your recommended router? chi, mux, something else?
But, if you care about speed take a look at httprouter. That's the one we're using in our company. It's fast but the biggest downsides for me are:
-
go-mir - a toolkit to develop RESTful API backend service like develop service of gRPC
Mir is a toolkit to develop RESTful API backend service like develop service of gRPC. It adapt some HTTP framework sush as Gin, Chi, Hertz, Echo, Iris, Fiber, Macaron, Mux, httprouter。
-
Tools besides Go for a newbie
IDE: use whatever make you productive. I personally use vscode. VCS: git, as golang communities use github heavily as base for many libraries. AFAIK Linter: use staticcheck for linting as it looks like mostly used linting tool in go, supported by many also. In Vscode it will be recommended once you install go plugin. Libraries/Framework: actually the standard libraries already included many things you need, decent enough for your day-to-day development cycles(e.g. `net/http`). But here are things for extra: - Struct fields validator: validator - Http server lib: chi router , httprouter , fasthttp (for non standard http implementations, but fast) - Web Framework: echo , gin , fiber , beego , etc - Http client lib: most already covered by stdlib(net/http), so you rarely need extra lib for this, but if you really need some are: resty - CLI: cobra - Config: godotenv , viper - DB Drivers: sqlx , postgre , sqlite , mysql - nosql: redis , mongodb , elasticsearch - ORM: gorm , entgo , sqlc(codegen) - JS Transpiler: gopherjs - GUI: fyne - grpc: grpc - logging: zerolog - test: testify , gomock , dockertest - and many others you can find here
-
shift: high-performance HTTP router for Go
Also, you seemed to have copied the path.go from Julien Schmidt's httprouter without even thanking or mentioning it in the README, which I think is not a good attitude. Yes, httprouter is BSD-3-Clause licensed, but showing the people that you took the code from some respect, should be a absolute must, in my opinon.
-
What mux/router to use now a days?
For a simple web app, https://github.com/julienschmidt/httprouter
-
Luciano Remes | Golang is 𝘼𝙡𝙢𝙤𝙨𝙩 Perfect
Take this as the high-performing router (I used this in an early demo for the company I worked for when we considered Golang). https://github.com/julienschmidt/httprouter/blob/34250257ea144905c752bfaae80d6885f190daf6/tree.go
-
Implemented a bench marker to compare Go's HTTP Router
The julienschmidt/go-http-routing-benchmark is the julienschmidt/httprouter, but maintenance seemed to have stopped in recent years, so I decided to create my own benchmarker and implement it. I decided to implement bench markers.
logrus
-
Authentication system using Golang and Sveltekit - Initialization and setup
It's some sort of logging system well explained by Alex Edwards in Let’s Go Further. As stated, we could have used logrus or any other popular logging system in Go.
-
Renaming public Go modules
Option 2, please. You may not have been around for the logrus debacle, but it was a giant pain.
- What is the common log library which is industry standard that is used in server applications?
-
Observing AWS Lambda with Golang and Datadog
For the example I’m using the very popular logrus library and then I’m setting the log formatter to be JSON
-
Best Logging Library for Golang
For choosing the candidates for the poll, I didn't do any thorough research. I was looking for a library to use in my project at work, and I ended up at sirupsen/logrus which was already being used by one of the dependencies in that project.
-
Follow up to previous post: I contributed to an open source project outside working hours despite being asked not to. I was fired. No legal action.
I contribute to OSS as part of my job on the regular. The company is good about contributing upstream, signing CLAs, and all that. We still work against private forks for two main reasons: 1. Some changes that we need are not accepted by maintainers based on philosophical or architectural reasons that we can’t otherwise work around. You’re beholden to then unless you publicly fork the repo which has other legal/PR overhead for the company and OSS political implications. 2. Maintainers in the past have taken down repos, renamed repos, or changed the licensing on repos that have left us in a lurch. We always build against our own private forks because we need predictability and can’t be beholden to some other party for business continuity. We sync them down from the public upstream at our leisure.
-
Sourcehut will blacklist the Go module mirror
If they change the case on their username on the other hand, the Go ecosystem explodes: https://github.com/sirupsen/logrus/issues/570#issuecomment-3...
-
Lies we tell ourselves to keep using Golang
Like, for example, some projects importing logrus with a capital L and some with a lowercase L, and go modules having no way to reconcile the two: https://github.com/sirupsen/logrus/issues/553
-
go-coffeeshop - A practical coffee shop application event-driven microservices built with Golang
Ugh. Wish people would stop using logrus. It’s in maintenance mode and slow, especially its stack tracing.
- Criando uma API Rest com Fiber - Uma história pessoal de aprendizado
What are some alternatives?
Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
zap - Blazing fast, structured, leveled logging in Go.
chi - lightweight, idiomatic and composable router for building Go HTTP services
zerolog - Zero Allocation JSON Logger
mux - A powerful HTTP router and URL matcher for building Go web servers with 🦍
glog - Leveled execution logs for Go
Echo - High performance, minimalist Go web framework
lumberjack - lumberjack is a log rolling package for Go
fasthttp - Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
slog
Fiber - ⚡️ Express inspired web framework written in Go
log15 - Structured, composable logging for Go