Running the Service
After designing and implementing your gRPC-based Goa service, you’ll want to run it locally and confirm it works as expected. In this tutorial, we’ll: Launch the gRPC server. Test the service using...
View ArticleRunning the Concerts Service
You’ve designed your API and implemented the service methods. Now it’s time to run the Concerts service and test its endpoints. 1. Start the Server From your project root, build and run your app: go...
View ArticleOverriding Error Serialization
This guide explains how to customize the way errors are serialized in Goa services. Error serialization is the process of converting error objects into a format that can be transmitted over HTTP or...
View ArticleJWT Authentication
JSON Web Tokens (JWT) provide a secure way to transmit claims between parties. They’re particularly useful in microservices architectures where you need to pass authentication and authorization...
View ArticleInterceptor Implementation
This guide explains how to implement interceptors in Goa, focusing on the flexibility provided by the interceptor pattern and the next function. Implementation Structure Goa generates type-safe...
View ArticleError Types
Goa allows you to define errors using either the default ErrorResult type or custom user-defined types. Choosing the appropriate error type depends on the complexity and specificity of the errors you...
View ArticleArchitecture Diagrams as Code
Modern software architectures, especially those built around microservices, require clear and maintainable documentation. While service contracts and API documentation are essential, understanding how...
View ArticleWriting Service Clients
When building microservices, a common challenge is how to structure the communication between services. This section covers best practices for writing clients to Goa services, focusing on creating...
View ArticleWhy Choose Goa?
When building microservices and APIs in Go, Goa’s code generation capabilities and design-first approach dramatically accelerate development. Let’s explore why Goa might be the perfect choice for your...
View ArticleTypes of Interceptors
Goa supports several types of interceptors to handle different scenarios. This guide explains the different types and when to use them. Core Concepts When designing interceptors, there are three key...
View ArticleTemplate Integration
Goa services can render dynamic HTML content using Go’s standard html/template package. This guide shows you how to integrate template rendering into your Goa service. Design First, define the service...
View ArticleGetting Support
Community Support Channels Slack Channel Join our Slack channel (part of the Gophers Slack) to: Chat with other Goa users Get quick help with questions Share ideas and experiences Connect with the...
View ArticleStream Interceptors
Stream gRPC Interceptors Stream interceptors handle streaming RPCs in gRPC services. They’re used when either the client, server, or both send multiple messages over a single connection. This guide...
View ArticleService Design
This guide explains how to design gRPC services using Goa’s DSL, focusing on service definitions and message types. For a comprehensive overview of Goa’s type system and data modeling capabilities,...
View ArticleHTTP Routing
Goa provides a powerful routing system that maps HTTP requests to your service methods. This guide covers: Basic routing concepts and service definitions HTTP methods and URL patterns Parameter...
View ArticleWorking with Multiple Services in Goa
In real-world applications, it’s common to have multiple services that work together to form a complete system. Goa makes it easy to design and implement multiple services within a single project. This...
View ArticleImplementing the Service
After designing your gRPC service with Goa’s DSL, it’s time to bring it to life! This guide will walk you through implementing your service step by step. You’ll learn how to: Generate the gRPC...
View ArticleImplementing
After designing your REST API with Goa’s DSL, it’s time to implement the service. This tutorial walks you through the implementation process step by step. Generate code using the Goa CLI (goa gen)...
View ArticleGeneration Process
Generation Pipeline When you run goa gen, Goa follows a systematic process to transform your design into working code: 1. Bootstrap Phase Goa first creates and runs a temporary program: During this...
View ArticleFirst Service
Prerequisites Ready to build something awesome? This guide assumes you have curl installed. Any other HTTP client will work as well. 1. Create a New Module Let’s start our journey by setting up a fresh...
View ArticleFile Uploads & Downloads
When building web services, handling file uploads and downloads is a common requirement. Whether you’re building a file sharing service, an image upload API, or a document management system, you’ll...
View ArticleError Propagation
This guide explains how errors propagate through different layers of a Goa service, from the business logic to the client. Overview Error propagation in Goa follows a clear path: Business logic...
View ArticleDistributed Tracing
Modern applications are complex distributed systems where a single user request might touch dozens of services, databases, and external APIs. When something goes wrong, it can be challenging to...
View ArticleDesigning Streaming Endpoints
Designing streaming endpoints in Goa involves defining methods that can handle the transmission of a sequence of results. Whether you’re implementing server-side streaming, client-side streaming, or...
View ArticleDefining Errors
Goa provides a flexible and powerful way to define errors within your service designs. By leveraging Goa’s Domain-Specific Language (DSL), you can specify both service-level and method-level errors,...
View ArticleCustom HTTP Middleware
Goa services use standard Go HTTP handlers, which means you can use any HTTP middleware that follows Go’s standard middleware pattern. This guide shows you how to create effective HTTP middleware that...
View ArticleAPI Key Authentication
API Key authentication is a simple and popular way to secure APIs. It involves distributing unique keys to clients who then include these keys in their requests. This method is particularly useful for...
View ArticleAPI Definition
API Definition The API function is a top-level DSL that defines the global properties of your service. It acts as the root of your design and establishes the foundation for all other components. Each...
View ArticleWhat is Goa?
Now that you understand why Goa can transform your API development, let’s explore how it works in practice. At its core, Goa is a design-first framework that revolutionizes how you build microservices...
View ArticleUnary Interceptors
Unary gRPC Interceptors Unary interceptors handle single request/response RPCs in gRPC services. They’re ideal for protocol-level concerns like metadata handling, logging, and monitoring. This guide...
View ArticleServing Files
Goa provides a straightforward way to serve static assets such as HTML, CSS, JavaScript, and images through the Files function in the service DSL. This function allows you to map HTTP paths to...
View ArticleProtocol Buffer Integration
Protocol Buffer Integration Goa manages Protocol Buffer generation and compilation through several key components: Automatic .proto Generation Goa automatically creates Protocol Buffer definitions from...
View ArticleUnderstanding Plugins
Goa plugins extend and customize the functionality of your APIs. Whether you need to add rate limiting, integrate monitoring tools, or generate code in different languages, plugins provide a flexible...
View ArticlegRPC Overview
Goa provides first-class support for designing and implementing gRPC services. This guide introduces the core concepts of using gRPC with Goa. What is gRPC? gRPC is a high-performance RPC (Remote...
View ArticleIntroduction
Streaming is a powerful feature that allows APIs to handle large volumes of data and real-time updates efficiently. In Goa, streaming support enables you to define endpoints that can send or receive a...
View ArticleIntroduction
Effective error handling is a cornerstone of building reliable and maintainable APIs. In the context of Goa, a design-first framework for building microservices Effective error handling is a...
View ArticleInstallation
Prerequisites Goa requires the use of Go modules, so ensure they’re enabled in your Go environment. Use Go 1.18+ (recommended). Enable Go Modules: Confirm they’re enabled in your environment (e.g.,...
View ArticleGetting Started with Interceptors
This guide will walk you through creating and using your first Goa interceptor. We’ll create a simple logging interceptor that records the timing of method calls. Defining an Interceptor Interceptors...
View ArticleDomain Vs Transport
When designing error handling in Goa, it’s important to understand the distinction between domain errors and their transport representation. This separation allows you to maintain clean domain logic...
View ArticleDesigning gRPC Services
In this tutorial, you’ll design a simple gRPC service with Goa. While Goa is often used for REST endpoints, it also has first-class support for gRPC transports. You’ll see how to: Define a service and...
View ArticleDesigning a REST API
This tutorial walks you through designing a REST API for managing music concerts using Goa. You’ll learn how to create a complete API design that includes common operations, proper HTTP mappings, and...
View ArticleData Modeling
Goa provides a powerful type system that allows you to model your domain with precision and clarity. From simple primitives to complex nested structures, the DSL offers a natural way to express data...
View ArticleContributing to Goa
Welcome to the Goa contributor’s guide! This document will help you understand how you can contribute to making Goa better. Whether you’re interested in improving code, documentation, or helping other...
View ArticleContent Negotiation
Content negotiation allows your HTTP services to support multiple content types and formats. Goa provides a flexible encoding and decoding strategy that makes it possible to associate arbitrary...
View ArticleCommand Line Tool
Installation Install Goa’s command-line tools using: go install goa.design/goa/v3/cmd/goa@latest Available Commands Generate Code (goa gen) goa gen <design-package-import-path> [-o...
View ArticleCombining Middleware and Interceptors
HTTP middleware and Goa interceptors can work together to create powerful, layered solutions. This guide explores patterns and strategies for combining them effectively. Core Concepts Data Flow The...
View ArticleBasic Setup
Setting up observability in a Goa service involves configuring Clue and OpenTelemetry. This guide walks through the essential setup steps. Prerequisites First, add the required dependencies to your...
View ArticleBasic Authentication
Basic Authentication is a simple authentication scheme built into the HTTP protocol. While it’s one of the simplest forms of authentication, it’s still widely used, especially for internal APIs or...
View ArticleServer-Sent Events
Server-Sent Events (SSE) is a HTTP-based server-to-client streaming protocol that enables real-time updates from the server to the client. Goa provides native support for implementing SSE endpoints,...
View ArticleSticky Cookies
When using streaming services / websockets you need to do some additional steps in your deployment. Why do we need sticky cookies? You might want to deploy your Goa Services into Kubernetes and do a...
View Article