Design first. Then win.
Design first. Then win.
Goa relies on code generation to alleviate the need for reflection or repetitive
coding.
The goagen tool generates various artifacts
including code, documentation, clients and even custom outputs via
plugins. The end result is application code that is
clean and terse.
The goa design language is flexible and stays out of the way – you decide how your API works. The design is the Single Source Of Truth from which both behavior and docs are derived. The goa design language being a Go DSL is easy to customize and the resulting designs are simple to share.
Request handlers get handed over a endpoint specific context object that exposes both the request state through convenient fields and the response state through methods that write the response back.
The API Development Life Cycle
Creating a service with goa starts with the design. The goa DSL lets you describe the global properties, types and endpoints that make up the service API. The apidsl package docs provides a quick reference to all the DSL functions.
Once the design of the API is in place goagen generates the corresponding data structures, validation code and handlers. Handlers are defined as interface methods. Implementing the service is thus as simple as implementing the generated interfaces.
The best part about the goa DSL is that the engine is completely decoupled. Plugins can implement custom DSLs to extend the concepts described in the design. Plugins can also generate arbitrary outputs.
Getting Started
1 Implement a simple goa service with the Getting Started Guide.
2 Learn more about the goa DSL.
3 Consult the examples and the goa-cellar service.
4 Join the slack channel (sign up here).
Learn more