mozilla-services/pushgo — pull request #42 by kitcambridge (2014-08-15 21:42:09+00:00)
Title: Implement pluggable storage adapters

This pull request refactors the existing memcached storage implementation, and adds a generic `Storage` interface for custom backing stores. A `NoStore` adapter is also included for Loop.

* The previous memcached routines have been extracted into an `EmceeStore` driver that supports dynamically-sized memcached pools.
* `{Gen, Resolve}PK` have been moved to `Store.{IDsToKey, KeyToIDs}`, respectively. This allows storage adapters to define their own key marshaling and unmarshaling routines.
* `storage.getElastiCacheEndpointsTimeout()` uses a buffered channel to avoid phantom Goroutines if the request times out.
* `{Handler, Application, PropPing, Serv}.storage` => `*.store`.
* `storage` is now loaded as an extensible section. The configuration loader will panic if the loaded logger and storage plug-ins do not satisfy their respective interfaces.
* Storage adapters are now closed on exit.

Closes #31. Awaiting r+ from @jrconlin, @bbangert.