Diesmal geht es um HTTP Libraries und Frameworks für Go. Jonathan fürchtet um seine Stellung als “Herr der Dinge”, denn bei Frameworks muss man sich manchmal in die Welt der Codegenerierung begeben. Hilfe, Kontrollverlust! Außerdem geht es darum, wie man gute Libraries erkennt und warum man eine spezielle lieber meiden sollte. Am Ende sprechen wir noch über Libraries für die Entwicklung von CLI Tools.
HTTP Frameworks Negroni (github.com/urfave/negroni)Negroni is an idiomatic approach to web middleware in Go. It is tiny, non-intrusive, and encourages use of net/http Handlers.
Kein Framework!
Vorteil
Nachteil
chi is a lightweight, idiomatic and composable router for building Go HTTP services. It’s especially good at helping you write large REST API services that are kept maintainable as your project grows and changes.
Positives
Nachteil
Gin is a web framework written in Go (Golang). It features a martini-like API with much better performance, up to 40 times faster thanks to httprouter. If you need performance and good productivity, you will love Gin.
Vergleichbar mit Express für Node oder Ktor für Kotlin. Sehr gut um schnell REST APIs zu entwickeln. Größere APIs sind auch kein Problem.
Positives
Nachteil
goa is a framework for building micro-services and REST APIs in Go using a unique design-first approach.
Erstellt mittels Code-Generation Boilerplate-Code, programmiert wird nur noch die Logik, der Rest wird generiert.
Nennenswert
A high productivity, full-stack web framework for the Go language.
Bietet wesentlich mehr Möglichkeiten als die bisher genannten. Dennoch geht es vergleichsweise low-levelig zu (vgl. Spring, Rails, SailsJs usw.).
Ist ein klassisches MVC mit template-engine, request validation usw.
Vorteile
Nachteile
Buffalo isn’t just a framework; it’s a holistic web development environment and project structure that lets developers get straight to the business of, well, building their business.
Features
Pluspunkte
Eine Nicht-Empfehlung
Features
Bedenklich
Swag converts Go annotations to Swagger Documentation 2.0.
Generiert eine swagger.json anhand von Kommentaren im Code.
Positives
Nachteil
This package contains a golang implementation of Swagger 2.0 (aka OpenAPI 2.0): it knows how to serialize and deserialize swagger specifications.
Gorilla Webtoolkit (gorillatoolkit.org)Gorilla is a web toolkit for the Go programming language.
Alles was man sonst noch so braucht, vor allem:
HTTP Multiplexer Implementierung werden häufig mit mux abgekürzt oder einfach “Router” genannt.
Weitere ProjekteEin weiteres HTTP Framework:
High performance, minimalist Go web framework
labstack/echo
Eine weitere HTTP Multiplexer Implementierung:
A high performance HTTP request router HttpRouter
Noch ein mux:
Goji is a minimalistic and flexible HTTP request multiplexer
Datenbank Library für MySQL, PostgreSQL, Sqlite3:
The fantastic ORM library for Golang, aims to be developer friendly gorm
Dateien, zum Bespiel HTML Templates, in Go Binaries einbauen:
Embed files into a Go executable statik
… eine weitere Möglichkeit:
The simple and easy way to embed static files into Go binaries. packr
Gültige (!) Zertifikate zum lokalen Entwickeln:
A simple zero-config tool to make locally trusted development certificates with any names you’d like. mkcert
Libraries für CLI Software go cui (github.com/jroimartin/gocui)Minimalist Go package aimed at creating Console User Interfaces.
termui (github.com/gizak/termui)termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of termbox-go.
promptui (github.com/manifoldco/promptui)Interactive prompt for command-line applications.
WeitereGebt uns Feedback auf Twitter:
oder per Email an feedback (at) codeandship.rocks.