toolkit with the most common functions for backend development
Start an http server
zero.Handle("/test", func(srv *zero.Server) {
name := srv.GetParam("name")
srv.HTML([]byte("Hello "+name))
})
zero.Serve("8080")
Start websocket server
zero.Handle("/websocket", func(srv *zero.Server) {
soc := srv.UpgradeWS()
soc.HandleAll()
})
zero.Serve("8080")
Stat module allow you to absorb app stats and get them once every configured period of time Example:
stat := zero.Stat{}
stat.Init(time.Minute*5, func(eventName string, counter zero.StatCounter) {
fmt.Println("for every key like", eventName, "you will ge counter object")
})
// adding event to stat
stat.Inc("some_event_name")