https://github.com/polldo/patweb
https://github.com/polldo/patweb
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/polldo/patweb
- Owner: polldo
- License: apache-2.0
- Created: 2022-07-27T05:58:45.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-08T23:12:16.000Z (almost 4 years ago)
- Last Synced: 2025-01-01T16:41:07.649Z (over 1 year ago)
- Language: Go
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This repo is intended to gather feedback and opinions on few good practices and techniques that could be ***helpful to craft better web servers in Go***.
Parts of the minimal web framework have been extracted and adapted from the excellent [ardanlabs/service](https://github.com/ardanlabs/service) repo.
The technique I'm trying to fit into the web server is the `opaque errors` one, by Dave Cheney.
(And yes, I'm a big fan of both Dave and Bill :smiley:)
The two main concepts on error handling that led me to this implementation are:
- handle errors once, in a centralized fashion using dedicated middleware.
- leverage opaque errors to decouple errors definitions from the web framework.
**Refs**:
- https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
- https://www.ardanlabs.com/blog/2017/05/design-philosophy-on-logging.html
- https://github.com/ardanlabs/service