Goa relies on code generation to alleviate the need for
reflection or repetitive coding.
The goa 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.
Goa generates code that follows best practice and is specially well suited for building microservice based system architectures. The code is organized in layers so that for example transport specific concerns do not leak up to the business logic.
The Service Development Life Cycle
Creating a service with Goa starts with the design. The Goa DSL lets you describe the service methods as well as their input and output data structures. The DSL also lets you define how to construct and serialize the data structures from and to transport specific data such as HTTP body, HTTP headers or gRPC messages.
The goa tool reads the service design and produces all the code required to build the service and a client tool. The generated code includes the transport layers and input validation. Implementing a service is thus as simple as implementing generated Go interfaces no matter what transport the service is listening to. In particular Goa makes it trivial to implement a service that accepts both HTTP and gRPC requests.
The best part about the Goa DSL is that the evaluation engine is completely decoupled. Plugins can implement custom DSLs to extend the concepts described in the design. Plugins can also generate arbitrary output or modify the output generated by the built-in code generators. In particular the go-kit plugin makes it possible to generate Go kit compliant services that can take advantage of the toolkit for operational and infrastructure needs.