gowebutils

module
v0.0.0-...-94dd30a Latest Latest
Warning

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

Go to latest
Published: Mar 1, 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
  • TODO: bearer token authentication
  • TODO: Role-based access control
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
pkg
mailutils
The mailer package contains a Mailer struct and associated methods for sending emails
The mailer package contains a Mailer struct and associated methods for sending emails
starter
Package starter provides an application server bootstrapper.
Package starter provides an application server bootstrapper.
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