hnlq715 / Doggy
Licence: mit
Lightweight, idiomatic and stable for building Go 1.7+ HTTP services
Stars: ✭ 268
Labels
Projects that are alternatives of or similar to Doggy
flute
The Application Framework Built for Powerful, Secure features and add-ons
Stars: ✭ 14 (-94.78%)
Mutual labels: web-framework
mux-python
Official Mux API wrapper for python projects, supporting both Mux Data and Mux Video.
Stars: ✭ 34 (-87.31%)
Mutual labels: mux
mux-go
Official Mux API wrapper for golang projects, supporting both Mux Data and Mux Video.
Stars: ✭ 69 (-74.25%)
Mutual labels: mux
mangooio
An Intuitive, Lightweight, High Performance Full Stack Java Web Framework.
Stars: ✭ 52 (-80.6%)
Mutual labels: web-framework
Bukdu.jl
Bukdu 🌌 is a web development framework for Julia
Stars: ✭ 125 (-53.36%)
Mutual labels: web-framework
go-mux-jwt-boilerplate
Golang REST API using MUX, GORM, and JWT for authentication
Stars: ✭ 41 (-84.7%)
Mutual labels: mux
kotlin-dropwizard
Getting Started with Dropwizard and Kotlin
Stars: ✭ 43 (-83.96%)
Mutual labels: web-framework
shivneri
Component based MVC web framework based on fort architecture targeting good code structures, modularity & performance.
Stars: ✭ 21 (-92.16%)
Mutual labels: web-framework
tinyhttp
🦕 Deno port of tinyhttp, 0-legacy, tiny & fast web framework
Stars: ✭ 84 (-68.66%)
Mutual labels: web-framework
flaskage
Flaskage is a complete and carefully designed template for use with the Flask web framework.
Stars: ✭ 36 (-86.57%)
Mutual labels: web-framework
Hunt Framework
A Web framework for D Programming Language. Full-stack high-performance.
Stars: ✭ 256 (-4.48%)
Mutual labels: web-framework
Doggy
Lightweight, idiomatic and stable for building Go 1.7+ HTTP services. It aims to provide a composable way to develop HTTP services.
dependency
- uber-go/zap
- gorilla/mux
- gorilla/schema
- urfave/negroni
- juju/ratelimit
- unrolled/render
- asaskevich/govalidator.v4
- julienschmidt/httprouter
Generate api struct
curl -s https://api.github.com/repos/chimeracoder/gojson | gojson -name=Repository -tags=schema,json
Generate model package
xo mysql://user:[email protected]:port/db -o . --template-path templates --ignore-fields updateTime
Example
package main
import (
"net/http"
"net/url"
"time"
"github.com/hnlq715/doggy"
"github.com/hnlq715/doggy/httpclient"
"github.com/hnlq715/doggy/middleware"
"github.com/hnlq715/doggy/render"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
m := doggy.NewMux()
m.Handle("/metrics", promhttp.Handler())
m.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {
processTime := 4 * time.Second
ctx := r.Context()
select {
case <-ctx.Done():
return
case <-time.After(processTime):
}
render.Text(w, 200, "pong")
})
m.HandleFunc("/get", func(w http.ResponseWriter, r *http.Request) {
data := make(map[string]interface{})
u, _ := url.Parse("http://httpbin.org/get")
u.RawQuery = r.Form.Encode()
err := httpclient.Get(r.Context(), u.String()).ToJSON(&data)
if err != nil {
render.Text(w, 200, err.Error())
return
}
render.JSON(w, 200, data)
})
n := doggy.Classic()
n.Use(middleware.NewPrometheus())
n.UseHandler(m)
doggy.ListenAndServeGracefully(n)
}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].