medeina alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view medeina alternatives based on common mentions on social networks and blogs.
-
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. -
Gorilla WebSocket
DISCONTINUED. A fast, well-tested and widely used WebSocket implementation for Go. -
Iris
The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio :rocket: -
GoFrame
GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang. -
goa
🌟 Goa: Elevate Go API development! 🚀 Streamlined design, automatic code generation, and seamless HTTP/gRPC support. ✨ -
Faygo
Faygo is a fast and concise Go Web framework that can be used to develop high-performance web app(especially API) with fewer codes. Just define a struct handler, faygo will automatically bind/verify the request parameters and generate the online API doc. -
Huma
A modern, simple, fast & flexible micro framework for building HTTP REST/RPC APIs in Go backed by OpenAPI 3 and JSON Schema. -
GoFr
An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability. -
go-server-timing
DISCONTINUED. Go (golang) library for creating and consuming HTTP Server-Timing headers
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of medeina or a related project?
README
Medeina
Medeina is a Go routing tree based on HttpRouter and inspired by Ruby's Roda and Cuba. It allows to define the HTTP routes of your web application as a tree, operating on the current route at any point of the tree.
As stated in Roda's website, "this allows you to have much DRYer code". All the routes can have all the features of HttpRouter: named paramaters, catch-all parameters, etc.
Actually, Medeina inherits all the performance and flexibility you love in HttpRouter (great job, Julien!).
Status
Medeina is fully functional and tested but it's still green and young. It may lack some useful functionality. If you use HttpRouter, give Medeina a try. All real world experience is welcome.
Install
go get github.com/imdario/medeina
// use in your .go code
import (
"github.com/imdario/medeina"
)
Usage
Check the docs and these examples:
// From Roda's site
r := medeina.NewMedeina()
r.GET(func() {
r.Is("", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
http.Redirect(w, r, "/hello", http.StatusFound)
})
r.On("hello", func() {
r.Is("world", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
fmt.Fprintf(w, "Hello world!")
})
r.Is("", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
fmt.Fprintf(w, "Hello!")
})
})
})
log.Fatal(http.ListenAndServe(":8080", r))
And this for a quick and dirty "REST-like" API (ignore the fact that I'm using a single method to handle everything):
endpoints := []string {
"department", "employee", "project"
}
r := medeina.NewMedeina()
r.GET(func() {
r.Is("", Index)
})
for endpoint := range endpoints {
r.On(endpoint, func() {
r.GET(func() {
r.Is(":id", Model)
})
r.POST(func() {
r.Is("", Model)
})
r.PUT(func() {
r.Is("", Model)
})
r.DELETE(func() {
r.Is(":id", Model)
})
})
}
log.Fatal(http.ListenAndServe(":8080", r))
Or it's "shorter" (YMMV) form:
endpoints := []string {
"department", "employee", "project"
}
r := medeina.NewMedeina()
r.Is("", Index, medeina.GET)
for endpoint := range endpoints {
r.On(endpoint, func() {
r.Is("", Model, medeina.POST, medeina.PUT)
r.Is(":id", Model, medeina.GET, medeina.DELETE)
})
}
log.Fatal(http.ListenAndServe(":8080", r))
What does "" means? It matches the current path in your route. It's a way to easily match the scope itself as canonical URL.
Why HttpRouter?
Because it's the most fast and flexible Go HTTP router around the town and a good one to start. If you want Medeina to work with your preferred option, patches are welcome!
If you don't know HttpRouter, please check it out. You won't regret it.
Why is it called Medeina?
From Wikipedia:
Medeina or Medeinė (derived from medis (tree) and medė (forest)), [...] is one of the main deities in the Lithuanian mythology, similar to Latvian Meža Māte. She is a ruler of forests, trees and animals. Her sacred animal is a hare.
Hey, we were talking about trees. It fits right! Also, this project can join my other ones, also called by names starting by 'm': Mergo, Minshu, mqqsig192, etc. Don't ask, it wasn't on purpose.
Contact me
If I can help you, you have an idea or you are using Medeina in your projects, don't hesitate to drop me a line (or a pull request): @im_dario
About
Written by Dario Castañé.
License
MIT license.
*Note that all licence references and agreements mentioned in the medeina README section above
are relevant to that project's source code only.