package
module
Version:
v0.0.0-...-a4dd944
Opens a new window with list of versions in this module.
Published: Feb 3, 2020
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Some Goji middleware
Some simple Goji middleware I've found useful. Find the documentation at http://godoc.org/github.com/philpearl/tt_goji_middleware.
The middleware is arranged in packages based on external dependencies
- base has no external dependencies except Goji
- postgres depends on github.com/lib/pq
- raven depends on github.com/kisielk/raven-go/raven
- redis depends on github.com/garyburd/redigo/redis
Just go get the sub-packages you need.
What's included
In base:
- Set something in Context for all requests. For example global configuration or a database connection pool
- Error catching and reporting
- Logging ('fraid I don't like the Goji version)
- A very simple GZIP
- Strip a prefix from the url
- Session middleware.
In postgres:
- A postgres based session store for the base session middleware
In raven:
- Catch panics, log them, send responses and report them to Sentry
In redis:
- Ensure there's a redis connection in c.Env["redis"]. Connections come from a pool and are not opened until used.
- A Redis based rate limiter that issues a single command to Redis per request.
- A Redis based session store for the base session middleware
Contributing
Pull requests are more than welcome!
Documentation
¶
Package tt_goji_middleware contains some simple middleware for Goji
Middleware is arranged into sub-packages based on their external dependencies.
Source Files
¶
Directories
¶
Package base contains middleware that has no external dependencies except Goji
|
Package base contains middleware that has no external dependencies except Goji |
Package postgres contains code that depends on a Postgresql database backend, and github.com/lib/pq
|
Package postgres contains code that depends on a Postgresql database backend, and github.com/lib/pq |
Package raven contains middleware than depends on github.com/kisielk/raven-go/raven
|
Package raven contains middleware than depends on github.com/kisielk/raven-go/raven |
Package redis contains middleware that depends on github.com/garyburd/redigo/redis
|
Package redis contains middleware that depends on github.com/garyburd/redigo/redis |
Click to show internal directories.
Click to hide internal directories.