How seahuyty/goghi works
This repository contains two small Go HTTP services: a post service on port 8081 and a user service on port 8082. Each exposes a health endpoint and a database endpoint; the latter invokes its service-specific PostgreSQL connector, which reads DATABASE_URL or uses a local default and pings the database. The excerpts show these routes and connection attempts, but do not establish how the SQL migrations are applied or whether the services are deployed together.
Main entry points: cmd/main.go Post service · cmd/main.go User service · database/database.go Post DB connector · database/database.go User DB connector
Components 6
HTTP services
- Post service
services/post-service/cmd/main.go - User service
services/user-service/cmd/main.go
Database access
- Post DB connector
services/post-service/internal/database/database.go - User DB connector
services/user-service/internal/database/database.go
Other components
- HTTP client
- PostgreSQL
Connections 6
- HTTP client → Post service: requests routes
services/post-service/cmd/main.go - HTTP client → User service: requests routes
services/user-service/cmd/main.go - Post service → Post DB connector: invokes on /database
services/post-service/cmd/main.go - User service → User DB connector: invokes on /database
services/user-service/cmd/main.go - Post DB connector → PostgreSQL: opens and pings
services/post-service/internal/database/database.go - User DB connector → PostgreSQL: opens and pings
services/user-service/internal/database/database.go