gowebutils

module
v0.0.0-...-0c6c348 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2025 License: MIT

README

Go Web Application Skeleton

Features
HTTP
  • structured logging
  • middleware for logging, panic recovery, cors, session management, rate limiting, and gzip
  • error response handling
  • sensible defaults for http server with graceful shutdown
  • utilities for handling JSON requests/responses, query string and url path parameter parsing
  • https and http/2 out-of-the-box
Security
  • Support for oauth2 authentication code flow. Tested with AWS Cognito.
  • invite user flow support
  • session management
  • Role-based access control
  • TODO: bearer token authentication
Email
  • templated email sending
File Storage
  • download/upload/delete files from s3
Payments
  • TODO: add payment service
Database
  • helpers for simple CRUD
  • dynamic query builder
  • database migrations
  • database seeding
Validation
  • simple validator for checking request errors
Testing
  • helpers for testing http endpoints
  • in-memory database for testing
Installation
  1. run ./setup.sh
  2. Create a cognito user pool and register an app. Set env vars in .env
  3. run make dev/run
Production

shutdown the server by running pkill -SIGTERM webapp

Directories

Path Synopsis
cmd
pkg
app
fsutils
The fsutils package provides utilities for managing files in an S3 bucket, including uploading, downloading, and deleting objects.
The fsutils package provides utilities for managing files in an S3 bucket, including uploading, downloading, and deleting objects.
mailutils
The mailer package enables sending emails using templates.
The mailer package enables sending emails using templates.
templateutils
Package templateutils is a package that provides utility functions for loading and using templates.
Package templateutils is a package that provides utility functions for loading and using templates.
validation
Package validation provides a validator for validating user input.
Package validation provides a validator for validating user input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL