Skip to content

timisbusy/tt_goji_middleware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some Goji middleware

Some simple Goji middleware I've found useful. Find the documentation at http://godoc.org/github.com/philpearl/tt_goji_middleware.

Build Status GoDoc

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!

About

Some simple middleware for Goji

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%