Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
Go advanced projects, Kafka, PostgreSQL
·
Module 3
Building a REST API with Swappable Storage
1
Building RESTful APIs with Go and Chi
Design and implement a REST API server using the chi router with clean route grouping.
2
JSON Request/Response with Error Handling
Implement structured JSON request parsing and response writing with proper error handling.
Viper for Application Configuration
Load application configuration from environment variables and files using a library like viper.
4
Integrating PostgreSQL with Dependency Injection
Wire the PostgreSQL repository into the API handlers using dependency injection.
5
In-Memory Repository for Testing
Implement an in-memory storage backend satisfying the same repository interface for testing and development.
6
Configurable Data Backends
Swap between PostgreSQL and in-memory backends via configuration without changing application code.
7
Custom Error Handling with Wrapping and Unwrapping
Define and use custom error types with wrapping and unwrapping for domain-specific errors.
Previous module
Interface-Driven Design and PostgreSQL Integration
Next module
Production Readiness: Testing, Logging, and Shutdown