A simple, unbiased application framework with sane defaults.
fw
is a simple application framework for Go. Unlike most of the other
frameworks, this one is not coupled to a single transport layer (HTTP, gRPC),
in fact it does not make any assumptions about your application.
It can be a daemon, a simple cron job, or an HTTP server, nearly anything.
On the other hand, it's bit opinionated in terms of some common application components:
- go-kit is used for logging
- emperror is used for error handling
- opentracing is used for application traces
That said, using these components in your application is optional.
Since this library uses Glide I recommend using it in your project as well.
$ glide get github.com/goph/fw
package main
import "github.com/goph/fw"
func main() {
app := fw.NewApplication()
defer app.Close()
// your app logic
}
You can also take a look at some boilerplate code which relies on this framework.
When I first started to work with Go I was amazed by the standard library. (Almost) Everything I needed was already there. Of course not all of the tools were perfect, so I had to pull in some external libraries (logging, error handling, etc), but there was no need for any frameworks or complex configuration to build my applications.
Soon I realized that this "no framework" philosophy requires a lot of copy-pasting. So I created boilerplates to make copying easier. But it just didn't feel right either. It became clear that maintaining 5-6 applications still requires too much time.
So I went back to the table and came up with this library. Although it is a framework, I tried to build it in a way that supports easy extension. One could even just copy the whole thing.
Using this library one can avoid copying a lot of (unmodified) code. Furthermore, unlike the linked boilerplates the components in this library are fully tested.
The MIT License (MIT). Please see License File for more information.