A collection of reusable Go packages for building modern web applications. These packages provide common functionality with clean interfaces, making it easy to build scalable and maintainable applications.
| Package | Description |
|---|---|
| cache | Temporary data storage (Redis, in-memory) |
| container | Dependency injection container |
| httpclient | HTTP client with retry and timeout |
| httprouter | HTTP router with middleware |
| logging | Structured logging with log/slog, zap, and etc |
| mailer | Email sending (SMTP, AWS SES) |
| queue | Task queue with Redis |
| shared | Shared utilities |
| storage | File storage (Local, S3) |
| support | Support utilities |
| validation | Data validation with 20+ rules |
| view | Template rendering engine |
| workerpool | Concurrent task processing |
Install all packages:
go get github.com/fatkulnurk/foundationOr install specific packages:
# Install specific package
go get github.com/fatkulnurk/foundation/cache
go get github.com/fatkulnurk/foundation/queue// HTTP Router with Cache
r := httprouter.New()
cache := cache.NewRedisCache(config, redisClient)
r.GET("/users", func(w http.ResponseWriter, r *http.Request) {
users, _ := cache.Get(r.Context(), "users")
httprouter.WriteJSON(w, http.StatusOK, users)
})
// Background Queue
q, _ := queue.NewQueue(redisClient)
q.Enqueue(ctx, "email:send", payload, queue.MaxRetry(3))Each package has detailed documentation in its README file. Click on the package name in the table above to view its documentation.