This is talk about Starting with building web application with GolangRead less
![Go言語入門者が Webアプリケーション を作ってみた話 #devfest #gdgkyoto](https://cdn-ak-scissors.b.st-hatena.com/image/square/a70255fece818d7d3ff4bea797ca9c4073e41bd3/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fdevfest2014-141121234301-conversion-gate02-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)
Web アプリケーションを書くときは今までずっと 小さい物は web.go 大きい物は net/http というスタンスを何故か貫いて来たんだけど、最近ようやく web.go をやめて goji を使う様になった。 Goji A web microframework for Golang https://goji.io/ 理由としては Sinatra ライクでありながら高度な正規表現マッチも使えるルータ それでいて net/http コンパチ 簡単に実装出来るミドルウェアスタック グレースフルシャットダウン そして何と言っても速い ミドルウェアも一般的な Web アプリケーションを作るには十分な物が既に揃ってます。 それでもやっぱり大きめな物は net/http で書くんだけど、小規模から中規模な物を一気にゴリゴリっと書く場合には goji は便利です。もちろん Windows でも動きま
Introduction Welcome to Building Web Apps with Go! If you are reading this then you have just started your journey from noob to pro. No seriously, web programming in Go is so fun and easy that you won't even notice how much information you are learning along the way! Keep in mind that there are still portions of this book that are incomplete and need some love. The beauty of open source publishing
Help us understand the problem. What is going on with this article? 仕事で Golang を使ってウェブアプリを作ることになりそうなので、どんな構成がいいのか考えてみる。あくまで前提ありきの選択なので、何でもかんでも適用できるわけではない。 JS や静的ファイル部分は今のところ考慮していない。単によく知らないので。 突っ込み大歓迎です。これいいよ!とか教えてください 前提 多機能なフレームワークよりシンプルなフレームワークに色々組み合わせる方法をとりたい。 開発者は数名程度。Golang に精通している開発者が 1 名いる。残りはこれから。 開発者は Django での開発経験が豊富な人が多い 全員ウェブ開発経験はそれなりに積んでいる。 HTML と JSON 両方のパターンが存在するのでテンプレートエンジンは重要。 JS
port 80を開くためにはroot権限が必要だが、開いたあとはセキュリティーリスクを最小限にするために一般ユーザ権限に降格したい、というWebサーバをGoで書く例です。 【追記3】 下記の例ではLinuxで動作させた場合に不十分です。 Linuxではsetuidを呼び出したスレッドにしか効かないので、以下の例をそのままLinuxで動かすとsyscall.Setuid()は成功しますが、HTTPのHandlerでは別スレッドで動くことがあるため、rootのままで動作することになります。 methaneさんのコメントを参照ください rootで起動した状態で":80"をlistenして syscall.Setuid() で一般ユーザになり http.Serve()する package main import ( "net" "net/http" "syscall" "log" ) func m
Gin Gonic The fastest full-featured web framework for Golang. Crystal clear. Performance and productivity can work together Gin is a web framework written in Golang. It features a martini-like API with much better performance, up to 40 times faster. If you need performance and good productivity, you will love Gin. Low Overhead Powerful API You can add global, per-group, and per-route middlewares,
FINAL FANTASY Record Keeper用に作ったツールのGolang実装についていろいろ。
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く