hop

module
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0

README

Hop - Experimental

hop is a light-weight web toolkit for Go that emphasizes simplicity and ease of use. It's my personal collection of HTTP helpers and middleware that I've found useful in my projects. It helps me build web applications without the complexity of larger frameworks, while attempting to stay close to the standard library.

Why the name hop? Because it’s a small, light-weight toolkit that helps me "hop" into web development quickly!

Goals

This is primarily a personal toolkit that works well for my needs - it may or may not be your cup of tea. The goals of the project are:

  • Stay close to Go's standard library
  • Keep dependencies minimal
  • Use simple, predictable patterns
  • Have just enough structure to get going quickly
  • Be flexible and extensible

Sub-packages

  • chain - Middleware routines that mostly use the standard library.
  • conf - A simple configuration manager that uses the standard library's encoding/json package, env variables, and flags.
  • decode - A collection of decoding functions for various data types and formats (e.g. forms, json, etc).
  • log - A wrapper to set up a logger using the standard library's slog package.
  • render - A simple view manager for rendering HTML templates. It uses the html/template package from the standard library.
  • serve - A simple HTTP server with basic routing and middleware support.
  • sess - Session management interfaces, helpers, and middleware.
  • wrap - A collection of validation functions for various data types.
Brainstorming future sub-packages
  • auth - Authentication and authorization middleware.
  • cache - Caching/temporary storage middleware, helpers, and persistent key-value storage.
  • keep - A collection of helpers for keeping track of state and data across requests.
  • mail - Email sending and receiving helpers.
  • query - Database operations and helpers.
  • save - File upload and storage helpers.

TODO

  • Add more useful tests

Directories

Path Synopsis
Package conf provides a way to load configuration from JSON files and environment variables, along with a structure to hold the configuration settings for an application and the ability to set up command-line flags for configuration options.
Package conf provides a way to load configuration from JSON files and environment variables, along with a structure to hold the configuration settings for an application and the ability to set up command-line flags for configuration options.
env
Package cookies provides helpers for reading and writing cookies with various security features.
Package cookies provides helpers for reading and writing cookies with various security features.
db
Package db provides database-related helpers and utilities.
Package db provides database-related helpers and utilities.
postgres Module
sqlite_cgo Module
internal
Package logger provides some utility methods based around the standard library's slog.Logger package.
Package logger provides some utility methods based around the standard library's slog.Logger package.
Package mail provides a simple mailer that sends emails using the SMTP protocol.
Package mail provides a simple mailer that sends emails using the SMTP protocol.
notifications
Package notifications provides example email notifications.
Package notifications provides example email notifications.
secure
password
Package password provides functions for hashing and verifying passwords.
Package password provides functions for hashing and verifying passwords.
Package serve provides a way to create and manage an HTTP server, including routing, middleware, and graceful shutdown.
Package serve provides a way to create and manage an HTTP server, including routing, middleware, and graceful shutdown.
sess
Package wrap provides middleware functions for HTTP handlers, including security headers, CSRF protection, and panic recovery.
Package wrap provides middleware functions for HTTP handlers, including security headers, CSRF protection, and panic recovery.

Jump to

Keyboard shortcuts

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