9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Go 用 web ツールキット Gorilla に関するメモ

Last updated at Posted at 2013-12-07

Web 関連のユーティリティ群。フレームワークではありません。
http://www.gorillatoolkit.org/

gorilla/context

リクエストに紐づけてキーと値を放り込んでおける。
自分で context.Clear() して消す。ClearHandlermux などにまかせることも。

gorilla/mux

ルーティング。名前は HTTP request multiplexer から。けっこうリッチでいろいろやってくれる。一番よく使いそう。

gorilla/reverse

ルーティングに使うユーティリティ。正規表現を使って URL からパラメータを抽出したり、その逆で正規表現にパラメータを渡して URL を作ったり。

gorilla/rpc

RPC。できるだけ RESTful に行きたいので、当面使わないかも。

gorilla/schema

フォームから来たデータ(map[string][]string 型)で任意の struct のプロパティを埋める。

ちなみに map[string][]string は string -> string の slice の map。ネストしたデータの場合、キーは Phones.0.Label のように . で区切られている必要あり。

gorilla/securecookie

Cookie の改変防止と暗号化。

gorilla/sessions

いわゆるセッション。設定するには明示的に Save() が必要。flash 機能もあり。encoding.gob を使っている。gob.Register() で任意の型のポインタを登録可能。

9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?