SlideShare a Scribd company logo
goa TIPS
goa in
2017/06/16
” ”
HAL
WEB 4
tikasan
tikasan0804
goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
#goastudy
goa
goa


• GET /:id
• Header token 

• :id 

•
• GET /:id
• Header token 

• :id 

•
• GET /:id
• Header token 

• :id 

•
model
• GET /:id
• Header token 

• :id 

•
• GET /:id
• Header token 

• :id 

•
OSS
goaを使った開発TIPS@六本木一丁目
goa
VOYAGE GROUP 18 

goa@ 

goaを使った開発TIPS@六本木一丁目
https
ssh,https
push
master marge hook
deploy(rsync)
https
ssh,https
push
master marge hook
deploy(rsync)
v2
v1.2
v5.7
goaを使った開発TIPS@六本木一丁目
API
JSON
Client
JSON
v2
v1.2
v5.7
•
• 

• 

• 3
• 5
• 1 



goaを使った開発TIPS@六本木一丁目
View




goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
• 

• 





goa
goa
1. DSL
2. DSL
3.
goa
1. DSL
2. DSL
3.
DSL
• app:
• main: main
• client: API Go
• js: JavaScript API
• swagger: API Swagger
• schema: API Hyper-schema JSON
• gen:
• controller:
• bootstrap: app main client swagger
• app:
• main: main
• client: API Go
• js: JavaScript API
• swagger: API Swagger
• schema: API Hyper-schema JSON
• gen:
• controller:
• bootstrap: app main client swagger
API Swagger 

swagger
Swagger
Swagger
API 

mock
goa+swagger
• goa swagger 

• swagger 

• 

REST 

goaを使った開発TIPS@六本木一丁目












goaを使った開発TIPS@六本木一丁目


Swagger
goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
• DSL
• 







goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
• goa
•
•
•
• goa
•
•
•
goa
goa Go WAF




goadesign/goa-celler goadesign/examples

• goa
•
•
•
Github issue


• goa
•
•
•
go goa 





go goa
• goa
•
•
•


goa
•
•
• data


goa
•
•
• data
※
goaを使った開発TIPS@六本木一丁目
•
•
• DSL
•
•
•
•
• DSL
•
•
goaを使った開発TIPS@六本木一丁目
.
!"" app/
!"" client/
!"" design/
!"" main.go
!"" public/
!"" store/
!"" tool/
!"" account.go <— .go
!"" bottle.go
!"" health.go
!"" js.go
!"" public.go
#"" swagger.go
Controller 

repo: github.com/goadesign/goa-cellar
controllers 

.go package controllers 

main.go mount 

controllers 

.
!"" app/
!"" client/
!"" main.go
!"" controllers <—
$   !"" account.go
$   !"" bottle.go
$   !"" health.go
$   !"" js.go
$   !"" public.go
$   #"" swagger.go
!"" design/
!"" public/
#"" tool/
•
•
• DSL
•
•
DSL
goa
#
gen: clean generate
clean:
@rm -rf app
@rm -rf client
@rm -rf tool
@rm -rf public/swagger
@rm -rf public/schema
@rm -rf public/js
@rm -f cellar
generate:
@goagen app -d github.com/goadesign/goa-cellar/design
@goagen swagger -d github.com/goadesign/goa-cellar/design -o public
@goagen schema -d github.com/goadesign/goa-cellar/design -o public
@goagen client -d github.com/goadesign/goa-cellar/design
@goagen js -d github.com/goadesign/goa-cellar/design -o public
•
•
• DSL
•
•
DSL
package design
import (
. "github.com/goadesign/goa/design"
. "github.com/goadesign/goa/design/apidsl"
)
var _ = API("appengine", func() {
Title("The appengine example")
Description("A simple appengine example")
Contact(func() {
Name("goa team")
Email("admin@goa.design")
URL("http://goa.design")
})
License(func() {
Name("MIT")
URL("https://github.com/goadesign/goa/blob/master/LICENSE")
})
Docs(func() {
Description("goa guide")
URL("http://goa.design/getting-started.html")
})
Host("localhost:8080")
Scheme("http")
BasePath("/")
Origin("*", func() {
Methods("GET")
MaxAge(600)
Credentials()
})
})
var ExampleMediaType = MediaType("application/vnd.example+json", func() {
Description("example MediaType")
Attributes(func() {
design
goa-celler
• api_definition.go

API
• media_types.go

MediaType
• resources.go

Resource
• user_types.go

Type
goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
package design
import (
. "github.com/goadesign/goa/design"
. "github.com/goadesign/goa/design/apidsl"
)
// Account is the account resource media type.
var Account = MediaType("application/vnd.account+json", func() {
Description("A tenant account")
Attributes(func() {
Attribute("id", Integer, "ID of account", func() {
Example(1)
})
Attribute("href", String, "API href of account", func() {
Example("/accounts/1")
})
Attribute("name", String, "Name of account", func() {
Example("test")
})
Attribute("created_at", DateTime, "Date of creation")
Attribute("created_by", String, "Email of account owner", func() {
Format("email")
Example("me@goa.design")
})
Required("id", "href", "name", "created_at", "created_by")
})
View("default", func() {
Attribute("id")
Attribute("href")
Attribute("name")
Attribute("created_at")
Attribute("created_by")
})
goaを使った開発TIPS@六本木一丁目
design
!"" api_definition.go
!"" medias <- MediaType
$   !"" accounts.go
$   #"" bottles.go
#"" resources <- Resource
   !"" accounts.go
   #"" bottles.go
goaを使った開発TIPS@六本木一丁目
Resource
package resources <— resources
import (
. “github.com/hoge/foo/design/constant" <— import
"github.com/hoge/foo/design/media" <— import
. "github.com/goadesign/goa/design"
. "github.com/goadesign/goa/design/apidsl"
)
var _ = Resource("accounts", func() {
BasePath(“/accounts")
// media.hoge
DefaultMedia(media.accountsMedia)
Action("create", func() {
//
})
})
•
•
• DSL
•
•
.
!"" app/
!"" client/
!"" controllers/
!"" design/
!"" main.go
!"" public/
!"" swagger/
#"" tool/
.
!"" app/
!"" client/
!"" controllers/
!"" design/
!"" main.go
!"" public/
!"" swagger/
#"" tool/
DSL 

DSL 

※


.
!"" app/
!"" client/
!"" controllers/
!"" design/
!"" main.go
!"" public/
!"" swagger/
#"" tool/
gitignore
goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
design 



goagen 



goagen
•
•
• DSL
•
•


goa
goa
https://goa.design/ja/extend/generators/
goaを使った開発TIPS@六本木一丁目
https
ssh,https
push
master marge hook
deploy(rsync)
CI


goaを使った開発TIPS@六本木一丁目
• 

Swagger
• 

• issue
•
goa
go goa

More Related Content

PDF
Docker and serverless Randstad Jan 2019: OpenFaaS Serverless: when functions ...
PDF
Getting Started With Angular
KEY
GR8CONF Contributing Back To Grails
PDF
OpenAPI Specification概要
PDF
BDD API Tests with Gherkin and Behat
PDF
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
PDF
Swagger code motion talk
PDF
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)
Docker and serverless Randstad Jan 2019: OpenFaaS Serverless: when functions ...
Getting Started With Angular
GR8CONF Contributing Back To Grails
OpenAPI Specification概要
BDD API Tests with Gherkin and Behat
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Swagger code motion talk
Web APIs in Node.js Core: Past, Present, and Future (JSConf EU 2019)

What's hot (20)

PDF
Team Support in Concourse CI 2.0 #concourse_tokyo
PDF
淺談 Startup 公司的軟體開發流程 v2
PDF
Continuous Delivery - Voxxed Days Thessaloniki 21.10.2016
PDF
Continuous Delivery - Devoxx Morocco 2016
PDF
Fastest to Mobile with Scalatra + Swagger
PDF
SF Gradle Meetup - Netflix OSS
PDF
Git Aliases of the Gods!
PPTX
Swagger APIs for Humans and Robots (Gluecon)
PPTX
OWASP Nagpur Meet #3 Android RE
PDF
How to generate a REST CXF3 application from Swagger ApacheConEU 2016
PDF
Developing Faster with Swagger
PDF
Enterprise build tool gradle
PDF
Dev sum - Beyond REST with GraphQL in .Net
PDF
Swagger / Quick Start Guide
PDF
Railsで作るBFFの功罪
PDF
Rapid application development with spring roo j-fall 2010 - baris dere
PDF
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
PDF
Introduction to Usergrid - ApacheCon EU 2014
PDF
Get started with AAR
Team Support in Concourse CI 2.0 #concourse_tokyo
淺談 Startup 公司的軟體開發流程 v2
Continuous Delivery - Voxxed Days Thessaloniki 21.10.2016
Continuous Delivery - Devoxx Morocco 2016
Fastest to Mobile with Scalatra + Swagger
SF Gradle Meetup - Netflix OSS
Git Aliases of the Gods!
Swagger APIs for Humans and Robots (Gluecon)
OWASP Nagpur Meet #3 Android RE
How to generate a REST CXF3 application from Swagger ApacheConEU 2016
Developing Faster with Swagger
Enterprise build tool gradle
Dev sum - Beyond REST with GraphQL in .Net
Swagger / Quick Start Guide
Railsで作るBFFの功罪
Rapid application development with spring roo j-fall 2010 - baris dere
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Introduction to Usergrid - ApacheCon EU 2014
Get started with AAR
Ad

Similar to goaを使った開発TIPS@六本木一丁目 (20)

PDF
コードジェネレートとの付き合い方 @Go Conference 2018 Spring
PDF
Padrino - the Godfather of Sinatra
PPTX
goa Design first API Generation
PDF
REST easy with API Platform
PDF
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
PDF
Betabeers VII- Android Dev@GDGMallorca
PPTX
Women Who Code - RSpec JSON API Workshop
PPTX
Android application analyzer
PDF
Everything-as-code – Polyglotte Entwicklung in der Praxis
PDF
SimpleModelerによるAndroidアプリ自動生成 with g3/g4
PPT
Freelancer Weapons of mass productivity
KEY
WHAT IS HTML5? (at CSS Nite Osaka)
PDF
HTML5 & Friends
PDF
Infinum Android Talks #04 - How to publish an android archive (.aar) to Maven...
PDF
Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven...
KEY
Google App Engine Java, Groovy and Gaelyk
PDF
Mastering composer
PDF
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
KEY
Gae開発入門
PDF
DevSecCon Singapore 2018 - in graph we trust By Imran Mohammed
コードジェネレートとの付き合い方 @Go Conference 2018 Spring
Padrino - the Godfather of Sinatra
goa Design first API Generation
REST easy with API Platform
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Betabeers VII- Android Dev@GDGMallorca
Women Who Code - RSpec JSON API Workshop
Android application analyzer
Everything-as-code – Polyglotte Entwicklung in der Praxis
SimpleModelerによるAndroidアプリ自動生成 with g3/g4
Freelancer Weapons of mass productivity
WHAT IS HTML5? (at CSS Nite Osaka)
HTML5 & Friends
Infinum Android Talks #04 - How to publish an android archive (.aar) to Maven...
Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven...
Google App Engine Java, Groovy and Gaelyk
Mastering composer
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Gae開発入門
DevSecCon Singapore 2018 - in graph we trust By Imran Mohammed
Ad

More from jumpei chikamori (6)

PDF
Goのパッケージ管理 @Go合宿2018
PDF
システムリプレース業務のススメ@vsLT
PDF
すぐ使える!入門API設計ワークショップ
PDF
Goを好きになる方法@Go合宿
PDF
【第71回 Cocoa勉強会関西 】アプリをリリースして、得た知見と今後の課題。
PDF
【サポーターズKyoto勉強会】ざっくり理解するクラウドの基礎
Goのパッケージ管理 @Go合宿2018
システムリプレース業務のススメ@vsLT
すぐ使える!入門API設計ワークショップ
Goを好きになる方法@Go合宿
【第71回 Cocoa勉強会関西 】アプリをリリースして、得た知見と今後の課題。
【サポーターズKyoto勉強会】ざっくり理解するクラウドの基礎

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
A Presentation on Artificial Intelligence
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Approach and Philosophy of On baking technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Getting Started with Data Integration: FME Form 101
A Presentation on Artificial Intelligence
SOPHOS-XG Firewall Administrator PPT.pptx
Tartificialntelligence_presentation.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Approach and Philosophy of On baking technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Empathic Computing: Creating Shared Understanding

goaを使った開発TIPS@六本木一丁目