SlideShare a Scribd company logo
1 of 24
CyberAgent, Inc. All Rights Reserved.
goa :: Design-first API Generation
2015 December 4th
Date : 2017 March 10 Presenter : Y.Sugiyama
Who are you?01
Introduction Who are you?01
CyberAgent(2011~)
• Ameba Pigg
• Java, node.js, MongoDB
• Takusuta(Live Streaming)
• Golang(gin), node.js, python, MongoDB,and various on live streaming.
• Golang, node.js, a little Scala.
Yoshinori Sugiyama,age:36,github:syama666
What is goa?02
goa has three parts What is goa?02
• a Go DSL for describing the microservice API
• a tool for generating code and documentation from design DSL
• a library to support the implementation of microservices
design03
DSL examples for API design design03
// GET /v1/kings?page=1&perPage=10&sort=-kingsId
var _ = Resource("v1_kings", func() {
BasePath("/v1/kings")
Action("list", func() {
Routing(GET(""))
Description(”get kings list")
Param("page", Integer, "e.g.) page=1", func() {
Default(1)
})
Param("perPage", Integer, "e.g.) perPage=10", func()
{
Default(10)
})
Param("sort", String, "e.g.) sort=kingId or sort=-
kingId", func() {
Pattern("^-?[0-9a-zA-Z]+$")
Default("-kingId")
})
Response(OK, func() {
Media(ResponseKings)
})
DSL examples for API design design03
// PUT/v1/kings/1192
var _ = Resource("v1_kings", func() {
BasePath("/v1/kings")
Action("update", func () {
Routing(PUT("/:kingId"))
Description(”update
a king")
Params(func() {
Param("kingId", Integer)
})
Payload(UpdateKing)
Response(OK, func()
{
Media(ResponseOneKing)
})
})
DSL examples for API design design03
// base king type dsl
var baseKing = Type("baseKing", func() {
Attribute("kingId", Integer, func() {
Example(1192)
})
Attribute("name", String, func() {
Example("Louis XIV")
})
Attribute("age", Integer, func() {
Example(76)
})
})
DSL examples for API design design03
// Japanese Lord type dsl
var japaneseLord = Type("baseKing", func() {
Reference(baseKing)
Attribute("kingId")
Attribute("name")
Attribute("age")
Attribute("birthPlace", String, func(){
Example(“江戸”)
})
Required(
"kingId",
"name",
"age",
"birthPlace",
)
})
DSL to Swagger design03
Goa DSL to Swagger.json By goagen
API design lifecycle design03
Generating code and docs04
goagen’s sub commands Generating04
• main
• main.go and controller scaffolding
• controller
• only controller scaffolding
• app
• validation, context, etc
• client
• golang client
• swagger
• swagger json
• js
• javascript client
• schema
• JSON schema
directory/package structure Generating04
• main.go
• controller/
• gen/
• app/
• contexts.go
• controllers.go
• hrefs.go
• user_types.go
• media_types.go
• swagger/
• swagger.json
• swagger.yml
• design/
directory/package structure Generating04
• main.go
• controller/
• gen/
• app/
• contexts.go
• controllers.go
• hrefs.go
• user_types.go
• media_types.go
• swagger/
• swagger.json
• swagger.yml
• design/
main
app
swagger
directory/package structure Generating04
• main.go
• controller/
• gen/
• app/
• contexts.go
• controllers.go
• hrefs.go
• user_types.go
• media_types.go
• swagger/
• swagger.json
• swagger.yml
• design/
auto-generated, do not modify
Only scaffold, goa do not update
05 Overall view
lib,generated, and yours Overall view
05
Components structure Overall view
05
API sequence Overall view
05
06 digest
cool digest06
• Generating swagger docs.
• Generating validation-code, and scaffolding some.
• Output a better code than go-swagger -> https://github.com/go-
swagger/go-swagger
not cool digest06
• You need implements logic of convert from your model sturct to goa-
generated struct.
• If you want to customize the error response, you have to hack goa -
middleware.
https://github.com/goadesign/goa/issues/1076

More Related Content

Similar to goa Design first API Generation

goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目jumpei chikamori
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL Josh Price
 
Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Shuji Watanabe
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料Shinichi Ogawa
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure DataTaro L. Saito
 
DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化Tomoharu ASAMI
 
マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!mosa siru
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start GuideAndrii Gakhov
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responsesdarrelmiller71
 
Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Julien SIMON
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to SwaggerKnoldus Inc.
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileAmazon Web Services Japan
 
Document Model for High Speed Spark Processing
Document Model for High Speed Spark ProcessingDocument Model for High Speed Spark Processing
Document Model for High Speed Spark ProcessingMongoDB
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache UsergridDavid M. Johnson
 

Similar to goa Design first API Generation (20)

goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
 
Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Serverless - Developers.IO 2019
Serverless - Developers.IO 2019
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
 
JSON-B for CZJUG
JSON-B for CZJUGJSON-B for CZJUG
JSON-B for CZJUG
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
 
Gaej For Beginners
Gaej For BeginnersGaej For Beginners
Gaej For Beginners
 
DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化
 
マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start Guide
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
 
Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
 
Document Model for High Speed Spark Processing
Document Model for High Speed Spark ProcessingDocument Model for High Speed Spark Processing
Document Model for High Speed Spark Processing
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 

Recently uploaded

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Recently uploaded (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

goa Design first API Generation

  • 1. CyberAgent, Inc. All Rights Reserved. goa :: Design-first API Generation 2015 December 4th Date : 2017 March 10 Presenter : Y.Sugiyama
  • 3. Introduction Who are you?01 CyberAgent(2011~) • Ameba Pigg • Java, node.js, MongoDB • Takusuta(Live Streaming) • Golang(gin), node.js, python, MongoDB,and various on live streaming. • Golang, node.js, a little Scala. Yoshinori Sugiyama,age:36,github:syama666
  • 5. goa has three parts What is goa?02 • a Go DSL for describing the microservice API • a tool for generating code and documentation from design DSL • a library to support the implementation of microservices
  • 7. DSL examples for API design design03 // GET /v1/kings?page=1&perPage=10&sort=-kingsId var _ = Resource("v1_kings", func() { BasePath("/v1/kings") Action("list", func() { Routing(GET("")) Description(”get kings list") Param("page", Integer, "e.g.) page=1", func() { Default(1) }) Param("perPage", Integer, "e.g.) perPage=10", func() { Default(10) }) Param("sort", String, "e.g.) sort=kingId or sort=- kingId", func() { Pattern("^-?[0-9a-zA-Z]+$") Default("-kingId") }) Response(OK, func() { Media(ResponseKings) })
  • 8. DSL examples for API design design03 // PUT/v1/kings/1192 var _ = Resource("v1_kings", func() { BasePath("/v1/kings") Action("update", func () { Routing(PUT("/:kingId")) Description(”update a king") Params(func() { Param("kingId", Integer) }) Payload(UpdateKing) Response(OK, func() { Media(ResponseOneKing) }) })
  • 9. DSL examples for API design design03 // base king type dsl var baseKing = Type("baseKing", func() { Attribute("kingId", Integer, func() { Example(1192) }) Attribute("name", String, func() { Example("Louis XIV") }) Attribute("age", Integer, func() { Example(76) }) })
  • 10. DSL examples for API design design03 // Japanese Lord type dsl var japaneseLord = Type("baseKing", func() { Reference(baseKing) Attribute("kingId") Attribute("name") Attribute("age") Attribute("birthPlace", String, func(){ Example(“江戸”) }) Required( "kingId", "name", "age", "birthPlace", ) })
  • 11. DSL to Swagger design03 Goa DSL to Swagger.json By goagen
  • 14. goagen’s sub commands Generating04 • main • main.go and controller scaffolding • controller • only controller scaffolding • app • validation, context, etc • client • golang client • swagger • swagger json • js • javascript client • schema • JSON schema
  • 15. directory/package structure Generating04 • main.go • controller/ • gen/ • app/ • contexts.go • controllers.go • hrefs.go • user_types.go • media_types.go • swagger/ • swagger.json • swagger.yml • design/
  • 16. directory/package structure Generating04 • main.go • controller/ • gen/ • app/ • contexts.go • controllers.go • hrefs.go • user_types.go • media_types.go • swagger/ • swagger.json • swagger.yml • design/ main app swagger
  • 17. directory/package structure Generating04 • main.go • controller/ • gen/ • app/ • contexts.go • controllers.go • hrefs.go • user_types.go • media_types.go • swagger/ • swagger.json • swagger.yml • design/ auto-generated, do not modify Only scaffold, goa do not update
  • 19. lib,generated, and yours Overall view 05
  • 23. cool digest06 • Generating swagger docs. • Generating validation-code, and scaffolding some. • Output a better code than go-swagger -> https://github.com/go- swagger/go-swagger
  • 24. not cool digest06 • You need implements logic of convert from your model sturct to goa- generated struct. • If you want to customize the error response, you have to hack goa - middleware. https://github.com/goadesign/goa/issues/1076