Upgrade to Pro — share decks privately, control downloads, hide ads and more …

よく使っているライブラリ&ツール紹介

qushot
December 18, 2018

 よく使っているライブラリ&ツール紹介

qushot

December 18, 2018
Tweet

More Decks by qushot

Other Decks in Programming

Transcript

  1. Google Cloud Platform プレミアパートナー 自己紹介 - 名前: 本 雄太朗(@qushot) -

    所属: クラウドエース株式会社 - 業務: サーバサイド(GAE, GKE)をGoで開発 - Go歴: 1年くらい
  2. type Example struct { // OK: 1105530b-67ba-4173-994b-a6c09fcb9bef, NG: foobar UUID

    string `validate:"uuid4"` // OK: 0 - 100, NG: -1, 101 Age int `validate:"min=0,max=100"` // OK: #ff00ff, NG: red, green Color string `validate:"hexcolor"` } go-playground/validator.v9 https://github.com/go-playground/validator
  3. swaggo/swag // ShowAccount godoc // @Summary Show a account //

    @Description get string by ID // @Accept json // @Produce json // @Param id path int true "Account ID" // @Success 200 {object} model.Account // @Failure 400 {object} controller.HTTPError // @Failure 404 {object} controller.HTTPError // @Failure 500 {object} controller.HTTPError // @Router /accounts/{id} [get] func (c *Controller) ShowAccount(ctx *gin.Context) { //something } https://github.com/swaggo/swag
  4. func main() { e := echo.New() e.GET(“/swagger/*”, echoSwagger.WrapHandler) e.Logger.Fatal(e.Start(“:1323”)) }

    http://localhost:1323/swagger/index.html にアクセス! swaggo/echo-swagger https://github.com/swaggo/echo-swagger