● API がたくさんあると struct を用意するのが面倒 ○ 100〜の API に対して req / res を調べて struct を書くのはとても大変 ○ 変更に追従する必要もあり更に大変 7 Req / Res に対応する struct を定義する……? type Response struct { ID int `json:"id"` Name string `json:"name"` ... ... ... ... } type Response struct { ID int `json:"id"` Name string `json:"name"` ... ... ... ... } type Response struct { ID int `json:"id"` Name string `json:"name"` ... ... ... ... } type Response struct { ID int `json:"id"` Name string `json:"name"` ... ... ... ... } type Response struct { ID int `json:"id"` Name string `json:"name"` ... ... ... ... } type FooResponse struct { ID int `json:"id"` Name string `json:"name"` ... ... ... ... } ・ ・ ・ ・
19 今日話したこと YAML HTTP API definition PHP API server impl. Unity (C#) API client impl. Go API client impl. 話してない 話してない Go 標準テンプレート を用いて生成 ProtoBuf prizm message definition Unity (C#) prizm client impl. Go prizm server / client impl. 話してない .proto の定義を もとに1行1行 ソースコードを 生成