Artwork

内容由Code and Ship提供。所有播客内容(包括剧集、图形和播客描述)均由 Code and Ship 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal
Player FM -播客应用
使用Player FM应用程序离线!

Go Libraries

1:09:41
 
分享
 

已归档的系列专辑 ("不活跃的收取点" status)

When? This feed was archived on January 31, 2025 00:41 (2M ago). Last successful fetch was on October 02, 2024 04:06 (6M ago)

Why? 不活跃的收取点 status. 我们的伺服器已尝试了一段时间,但仍然无法截取有效的播客收取点

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 235783912 series 2513100
内容由Code and Ship提供。所有播客内容(包括剧集、图形和播客描述)均由 Code and Ship 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal

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

  • Nah an der Standard Library

Nachteil

  • Kein automatischen Binding/Rendering
    • Requests werden nicht automatisch in Structs gemarshalt
    • Responses werden nicht automatisch zu JSON umgewandelt.

Go Chi (github.com/go-chi/chi)

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

  • Nah an der Standard Library

Nachteil

  • Kein automatischen Binding/Rendering
    • Requests werden nicht automatisch in Structs gemarshalt
    • Responses werden nicht automatisch zu JSON umgewandelt.
  • Man muss leere Interface Methoden implementieren um ein Struct überhaupt rendern oder binden zu können

Gin-Gonic (gin-gonic.com)

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

  • Einfache API
  • Aufgeräumte Doku
  • Erweiterbar trotz eigener Handler Implementierung (gin.WrapF)
  • Sehr einfaches Rendering (JSON, HTML)

Nachteil

  • Manche Middlewares sind nicht so optimal (CORS)

Goa (github.com/goadesign)

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

  • Unterstützt OAuth2

Revel (revel.github.io)

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

  • Hot Code Reloading
  • MVC mit Template-Engine
  • Request Validation

Nachteile

  • Keine einfache, eingebaute Möglichkeit Datenbanken anzubinden
    • Es werden gorm oder andere externe Libraries empfohlen
  • Für Authentication werden ebenfalls externe Libraries empfohlen

Buffalo (github.com/gobuffalo/buffalo)

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

  • Templating
  • Routing
  • Task Runner (optional)
  • Models/ORM (optional)
  • Sessions, Cookies, WebSockets uvm.

Pluspunkte

  • Gute Doku
  • Viele Tutorials und Beispiele

Iris (github.com/kataras/iris)

Eine Nicht-Empfehlung

Features

  • Sehr umfangreiche Funktionen
  • Form-Validation
  • Controller, ähnlich wie in anderen großen Web Frameworks

Bedenklich

  • Thread bei /r/golang
  • Ziemlich merkwürdige Vergangenheit
  • Git History wurde mehrfach gesquashed, so dass Contributors nicht mehr sichtbar sind
  • Nutzt falsche oder gefakete Benchmarks, die wenig Aussagekraft haben (Autor von Iris ist Co-Autor des verklinkten Benchmarks)
  • Maintainer Verhalten verstößt gegen den Golang Code of Conduct
  • “Unbeatable free support for everyone”

HTTP Libraries

Swag (github.com/swaggo/swag)

Swag converts Go annotations to Swagger Documentation 2.0.

Generiert eine swagger.json anhand von Kommentaren im Code.

Positives

  • HTTP Framework/Library unabhängig
  • Wenn man die API einmal geblickt hat ist es sehr einfach zu benutzten.
  • Bietet auch Code-Generation features (haben wir nicht getestet)

Nachteil

  • Doku nur in der README und auf godoc.org
  • Einige Features mehr oder weniger nicht dokumentiert

go-swagger (github.com/go-swagger/go-swagger)

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:

  • context: stores global request variables.
  • mux: is a powerful URL router and dispatcher.
  • schema: converts form values to a struct.
  • securecookie: encodes and decodes authenticated and optionally encrypted cookie values.
  • sessions: saves cookie and filesystem sessions and allows custom session backends.
  • websocket: implements the WebSocket protocol defined in RFC 6455.

HTTP Multiplexer Implementierung werden häufig mit mux abgekürzt oder einfach “Router” genannt.

Weitere Projekte

Ein 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)

gocui demo

Minimalist Go package aimed at creating Console User Interfaces.

termui (github.com/gizak/termui)

termui demo

termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of termbox-go.

promptui (github.com/manifoldco/promptui)

PromptUI Demo

Interactive prompt for command-line applications.

Weitere

  • Filewatcher für schnelles Entwickeln: gow
  • Frotschrittsbalken: uiprogress

Vielen Dank fürs Zuhören!

Gebt uns Feedback auf Twitter:

oder per Email an feedback (at) codeandship.rocks.

  continue reading

51集单集

Artwork

Go Libraries

Code and Ship

18 subscribers

published

icon分享
 

已归档的系列专辑 ("不活跃的收取点" status)

When? This feed was archived on January 31, 2025 00:41 (2M ago). Last successful fetch was on October 02, 2024 04:06 (6M ago)

Why? 不活跃的收取点 status. 我们的伺服器已尝试了一段时间,但仍然无法截取有效的播客收取点

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 235783912 series 2513100
内容由Code and Ship提供。所有播客内容(包括剧集、图形和播客描述)均由 Code and Ship 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal

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

  • Nah an der Standard Library

Nachteil

  • Kein automatischen Binding/Rendering
    • Requests werden nicht automatisch in Structs gemarshalt
    • Responses werden nicht automatisch zu JSON umgewandelt.

Go Chi (github.com/go-chi/chi)

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

  • Nah an der Standard Library

Nachteil

  • Kein automatischen Binding/Rendering
    • Requests werden nicht automatisch in Structs gemarshalt
    • Responses werden nicht automatisch zu JSON umgewandelt.
  • Man muss leere Interface Methoden implementieren um ein Struct überhaupt rendern oder binden zu können

Gin-Gonic (gin-gonic.com)

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

  • Einfache API
  • Aufgeräumte Doku
  • Erweiterbar trotz eigener Handler Implementierung (gin.WrapF)
  • Sehr einfaches Rendering (JSON, HTML)

Nachteil

  • Manche Middlewares sind nicht so optimal (CORS)

Goa (github.com/goadesign)

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

  • Unterstützt OAuth2

Revel (revel.github.io)

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

  • Hot Code Reloading
  • MVC mit Template-Engine
  • Request Validation

Nachteile

  • Keine einfache, eingebaute Möglichkeit Datenbanken anzubinden
    • Es werden gorm oder andere externe Libraries empfohlen
  • Für Authentication werden ebenfalls externe Libraries empfohlen

Buffalo (github.com/gobuffalo/buffalo)

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

  • Templating
  • Routing
  • Task Runner (optional)
  • Models/ORM (optional)
  • Sessions, Cookies, WebSockets uvm.

Pluspunkte

  • Gute Doku
  • Viele Tutorials und Beispiele

Iris (github.com/kataras/iris)

Eine Nicht-Empfehlung

Features

  • Sehr umfangreiche Funktionen
  • Form-Validation
  • Controller, ähnlich wie in anderen großen Web Frameworks

Bedenklich

  • Thread bei /r/golang
  • Ziemlich merkwürdige Vergangenheit
  • Git History wurde mehrfach gesquashed, so dass Contributors nicht mehr sichtbar sind
  • Nutzt falsche oder gefakete Benchmarks, die wenig Aussagekraft haben (Autor von Iris ist Co-Autor des verklinkten Benchmarks)
  • Maintainer Verhalten verstößt gegen den Golang Code of Conduct
  • “Unbeatable free support for everyone”

HTTP Libraries

Swag (github.com/swaggo/swag)

Swag converts Go annotations to Swagger Documentation 2.0.

Generiert eine swagger.json anhand von Kommentaren im Code.

Positives

  • HTTP Framework/Library unabhängig
  • Wenn man die API einmal geblickt hat ist es sehr einfach zu benutzten.
  • Bietet auch Code-Generation features (haben wir nicht getestet)

Nachteil

  • Doku nur in der README und auf godoc.org
  • Einige Features mehr oder weniger nicht dokumentiert

go-swagger (github.com/go-swagger/go-swagger)

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:

  • context: stores global request variables.
  • mux: is a powerful URL router and dispatcher.
  • schema: converts form values to a struct.
  • securecookie: encodes and decodes authenticated and optionally encrypted cookie values.
  • sessions: saves cookie and filesystem sessions and allows custom session backends.
  • websocket: implements the WebSocket protocol defined in RFC 6455.

HTTP Multiplexer Implementierung werden häufig mit mux abgekürzt oder einfach “Router” genannt.

Weitere Projekte

Ein 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)

gocui demo

Minimalist Go package aimed at creating Console User Interfaces.

termui (github.com/gizak/termui)

termui demo

termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of termbox-go.

promptui (github.com/manifoldco/promptui)

PromptUI Demo

Interactive prompt for command-line applications.

Weitere

  • Filewatcher für schnelles Entwickeln: gow
  • Frotschrittsbalken: uiprogress

Vielen Dank fürs Zuhören!

Gebt uns Feedback auf Twitter:

oder per Email an feedback (at) codeandship.rocks.

  continue reading

51集单集

所有剧集

×
 
Loading …

欢迎使用Player FM

Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。

 

快速参考指南

边探索边听这个节目
播放